Release GIL during image load (decode).

This commit is contained in:
Lawrence Kesteloot 2015-05-09 22:10:05 -07:00
parent 55ec522727
commit b503d27f45

View File

@ -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);
}