Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::PythonInterface::ReleaseGlobalInterpreterLock Class Reference

Defines a structure for releasing the Python GIL using the RAII pattern. More...

#include <ReleaseGlobalInterpreterLock.h>

Public Member Functions

 ReleaseGlobalInterpreterLock ()
 Default constructor. More...
 
 ~ReleaseGlobalInterpreterLock ()
 Destructor. More...
 

Private Attributes

PyThreadState * m_saved
 
PyObject * m_tracearg
 
Py_tracefunc m_tracefunc
 

Detailed Description

Defines a structure for releasing the Python GIL using the RAII pattern.

This releases the Python GIL for the duration of the current scope.

Definition at line 20 of file ReleaseGlobalInterpreterLock.h.

Constructor & Destructor Documentation

◆ ReleaseGlobalInterpreterLock()

Mantid::PythonInterface::ReleaseGlobalInterpreterLock::ReleaseGlobalInterpreterLock ( )

Default constructor.

Ensures this thread releases the Python GIL also save trace information to be restored upon destruction.

Definition at line 15 of file ReleaseGlobalInterpreterLock.cpp.

References m_saved, m_tracearg, and m_tracefunc.

◆ ~ReleaseGlobalInterpreterLock()

Mantid::PythonInterface::ReleaseGlobalInterpreterLock::~ReleaseGlobalInterpreterLock ( )

Destructor.

Restores the Python GIL to the thread when the object falls out of scope.

Definition at line 28 of file ReleaseGlobalInterpreterLock.cpp.

References m_saved, m_tracearg, and m_tracefunc.

Member Data Documentation

◆ m_saved

PyThreadState* Mantid::PythonInterface::ReleaseGlobalInterpreterLock::m_saved
private

◆ m_tracearg

PyObject* Mantid::PythonInterface::ReleaseGlobalInterpreterLock::m_tracearg
private

◆ m_tracefunc

Py_tracefunc Mantid::PythonInterface::ReleaseGlobalInterpreterLock::m_tracefunc
private

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