Public Member Functions | Private Attributes | List of all members
moveit::py_bindings_tools::GILReleaser Class Reference

RAII Helper to release the Global Interpreter Lock (GIL) More...

#include <gil_releaser.h>

Public Member Functions

 GILReleaser () noexcept
 Release the GIL on construction
More...
 
 GILReleaser (const GILReleaser &)=delete
 
 GILReleaser (GILReleaser &&other) noexcept
 
GILReleaseroperator= (const GILReleaser &)=delete
 
GILReleaseroperator= (GILReleaser &&other) noexcept
 
void swap (GILReleaser &other) noexcept
 
 ~GILReleaser () noexcept
 Reacquire the GIL on destruction
More...
 

Private Attributes

PyThreadState * m_thread_state
 

Detailed Description

RAII Helper to release the Global Interpreter Lock (GIL)

Use this helper class to release the GIL before doing long computations or blocking calls. Note that without the GIL Python-related functions must not be called. So, before releasing the GIL all boost::python variables have to be converted to e.g. std::vector<std::string>. Before converting the result back to e.g. a moveit::py_bindings_tools::ByteString instance, the GIL has to be reacquired.

Definition at line 118 of file gil_releaser.h.

Constructor & Destructor Documentation

◆ GILReleaser() [1/3]

moveit::py_bindings_tools::GILReleaser::GILReleaser ( )
inlinenoexcept

Release the GIL on construction

Definition at line 156 of file gil_releaser.h.

◆ ~GILReleaser()

moveit::py_bindings_tools::GILReleaser::~GILReleaser ( )
inlinenoexcept

Reacquire the GIL on destruction

Definition at line 161 of file gil_releaser.h.

◆ GILReleaser() [2/3]

moveit::py_bindings_tools::GILReleaser::GILReleaser ( const GILReleaser )
delete

◆ GILReleaser() [3/3]

moveit::py_bindings_tools::GILReleaser::GILReleaser ( GILReleaser &&  other)
inlinenoexcept

Definition at line 171 of file gil_releaser.h.

Member Function Documentation

◆ operator=() [1/2]

GILReleaser& moveit::py_bindings_tools::GILReleaser::operator= ( const GILReleaser )
delete

◆ operator=() [2/2]

GILReleaser& moveit::py_bindings_tools::GILReleaser::operator= ( GILReleaser &&  other)
inlinenoexcept

Definition at line 178 of file gil_releaser.h.

◆ swap()

void moveit::py_bindings_tools::GILReleaser::swap ( GILReleaser other)
inlinenoexcept

Definition at line 185 of file gil_releaser.h.

Member Data Documentation

◆ m_thread_state

PyThreadState* moveit::py_bindings_tools::GILReleaser::m_thread_state
private

Definition at line 152 of file gil_releaser.h.


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


planning_interface
Author(s): Ioan Sucan
autogenerated on Sat Apr 27 2024 02:27:01