mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 05:36:48 +03:00
Release GIL during image load (decode).
This commit is contained in:
parent
55ec522727
commit
b503d27f45
5
decode.c
5
decode.c
|
@ -116,12 +116,17 @@ _decode(ImagingDecoderObject* decoder, PyObject* args)
|
||||||
{
|
{
|
||||||
UINT8* buffer;
|
UINT8* buffer;
|
||||||
int bufsize, status;
|
int bufsize, status;
|
||||||
|
ImagingSectionCookie cookie;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, PY_ARG_BYTES_LENGTH, &buffer, &bufsize))
|
if (!PyArg_ParseTuple(args, PY_ARG_BYTES_LENGTH, &buffer, &bufsize))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
ImagingSectionEnter(&cookie);
|
||||||
|
|
||||||
status = decoder->decode(decoder->im, &decoder->state, buffer, bufsize);
|
status = decoder->decode(decoder->im, &decoder->state, buffer, bufsize);
|
||||||
|
|
||||||
|
ImagingSectionLeave(&cookie);
|
||||||
|
|
||||||
return Py_BuildValue("ii", status, decoder->state.errcode);
|
return Py_BuildValue("ii", status, decoder->state.errcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user