MIRA
Public Member Functions | List of all members
ScopedGILLock Class Reference

A scoped global interpreter (GIL) lock. More...

#include <python/ScopedGIL.h>

Public Member Functions

 ScopedGILLock ()
 
 ~ScopedGILLock ()
 
void unlock ()
 

Detailed Description

A scoped global interpreter (GIL) lock.

The GIL only allows one thread at a time to run in the python interpreter. It is VERY important to that you MUST NOT touch any python code, python data or call in to the interpreter while not holding the GIL. This will cause your interpreter to crash. So before interacting with python in any way you need to hold the GIL by creating an instance of ScopedGILLock. It will automatically release the lock when it goes out of scope.

{
// ...do python stuff
} // lock is released

Constructor & Destructor Documentation

◆ ScopedGILLock()

ScopedGILLock ( )
inline

◆ ~ScopedGILLock()

~ScopedGILLock ( )
inline

Member Function Documentation

◆ unlock()

void unlock ( )
inline

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