NRP Core  1.4.1
PythonGILLock Class Reference

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
 
PythonGILLockoperator= (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...
 

Detailed Description

Manages the Pyton GIL. Useful for threads.

Constructor & Destructor Documentation

◆ PythonGILLock() [1/2]

PythonGILLock::PythonGILLock ( PyGILState_STATE &  state,
const bool  acquire = true 
)

Constructor. Acquires GIL if requested.

Parameters
stateGIL State
acquireShould GIL be acquired

◆ ~PythonGILLock()

PythonGILLock::~PythonGILLock ( )

Releases GIL if previously acquired.

◆ PythonGILLock() [2/2]

PythonGILLock::PythonGILLock ( const PythonGILLock )
delete

Member Function Documentation

◆ acquire()

void PythonGILLock::acquire ( )

Acquire GIL.

◆ hasGIL()

static bool PythonGILLock::hasGIL ( )
static

Does this thread have the GIL?

◆ operator=()

PythonGILLock& PythonGILLock::operator= ( const PythonGILLock )
delete

◆ release()

void PythonGILLock::release ( )

Release GIL.


The documentation for this class was generated from the following files: