If a thread holds the global interpreter lock (GIL) but runs a long operation in C where it doesn't need to hold the GIL it can release it temporarily. More...
#include <Interpreter.h>
Public Member Functions | |
PyGILStateRelease () | |
~PyGILStateRelease () |
If a thread holds the global interpreter lock (GIL) but runs a long operation in C where it doesn't need to hold the GIL it can release it temporarily.
Or if the thread has to run code in the main thread where Python code may be executed it must release the GIL to avoid a deadlock. In either case the thread must hold the GIL when instantiating an object of PyGILStateRelease. As PyGILStateLocker it's best to create an instance of PyGILStateRelease on the stack.
Definition at line 113 of file Interpreter.h.
Base::PyGILStateRelease::PyGILStateRelease | ( | ) | [inline] |
Definition at line 116 of file Interpreter.h.
Base::PyGILStateRelease::~PyGILStateRelease | ( | ) | [inline] |
Definition at line 121 of file Interpreter.h.