knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::py::gil_lock Class Reference

#include <gil.h>

Public Member Functions

 gil_lock ()
 
 ~gil_lock ()
 
 gil_lock ()
 
 ~gil_lock ()
 

Detailed Description

RAII class to acquire the GIL. This is needed when executing C++ code that interacts with the Python interpreter.

Definition at line 31 of file gil.h.

Constructor & Destructor Documentation

◆ gil_lock() [1/2]

knowrob::py::gil_lock::gil_lock ( )
inline

Definition at line 33 of file gil.h.

33 { state_ = PyGILState_Ensure(); }

◆ ~gil_lock() [1/2]

knowrob::py::gil_lock::~gil_lock ( )
inline

Definition at line 35 of file gil.h.

35 { PyGILState_Release(state_); }

◆ gil_lock() [2/2]

knowrob::py::gil_lock::gil_lock ( )
inline

Definition at line 33 of file gil.h.

33 { state_ = PyGILState_Ensure(); }

◆ ~gil_lock() [2/2]

knowrob::py::gil_lock::~gil_lock ( )
inline

Definition at line 35 of file gil.h.

35 { PyGILState_Release(state_); }

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