From b503d27f45ff6d5f549e12757a7b9e4b2cf088d3 Mon Sep 17 00:00:00 2001 From: Lawrence Kesteloot Date: Sat, 9 May 2015 22:10:05 -0700 Subject: [PATCH] Release GIL during image load (decode). --- decode.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/decode.c b/decode.c index c56f42592..6299d9124 100644 --- a/decode.c +++ b/decode.c @@ -116,12 +116,17 @@ _decode(ImagingDecoderObject* decoder, PyObject* args) { UINT8* buffer; int bufsize, status; + ImagingSectionCookie cookie; if (!PyArg_ParseTuple(args, PY_ARG_BYTES_LENGTH, &buffer, &bufsize)) return NULL; + ImagingSectionEnter(&cookie); + status = decoder->decode(decoder->im, &decoder->state, buffer, bufsize); + ImagingSectionLeave(&cookie); + return Py_BuildValue("ii", status, decoder->state.errcode); }