Manages the Pyton GIL. Useful for threads. More...
#include <python_interpreter_state.h>
Public Member Functions | |
PythonGILLock (PyGILState_STATE &state, const bool acquire=true) | |
Constructor. Acquires GIL if requested. More... | |
~PythonGILLock () | |
Releases GIL if previously acquired. More... | |
PythonGILLock (const PythonGILLock &)=delete | |
PythonGILLock & | operator= (const PythonGILLock &)=delete |
void | acquire () |
Acquire GIL. More... | |
void | release () |
Release GIL. More... | |
Static Public Member Functions | |
static bool | hasGIL () |
Does this thread have the GIL? More... | |
Manages the Pyton GIL. Useful for threads.
PythonGILLock::PythonGILLock | ( | PyGILState_STATE & | state, |
const bool | acquire = true |
||
) |
Constructor. Acquires GIL if requested.
state | GIL State |
acquire | Should GIL be acquired |
PythonGILLock::~PythonGILLock | ( | ) |
Releases GIL if previously acquired.
|
delete |
void PythonGILLock::acquire | ( | ) |
Acquire GIL.
|
static |
Does this thread have the GIL?
|
delete |
void PythonGILLock::release | ( | ) |
Release GIL.