11#ifdef LIBCARLA_WITH_PYTHON_SUPPORT
12# if defined(__clang__)
13# pragma clang diagnostic push
14# pragma clang diagnostic ignored "-Wdeprecated-register"
16# include <boost/python.hpp>
17# if defined(__clang__)
18# pragma clang diagnostic pop
28#ifdef LIBCARLA_WITH_PYTHON_SUPPORT
29# if PY_MAJOR_VERSION >= 3
30 return PyGILState_Check();
32 PyThreadState *tstate = _PyThreadState_Current;
33 return (tstate !=
nullptr) && (tstate == PyGILState_GetThisThreadState());
40#ifdef LIBCARLA_WITH_PYTHON_SUPPORT
47 AcquireGIL() : _state(PyGILState_Ensure()) {}
50 PyGILState_Release(_state);
55 PyGILState_STATE _state;
63 ReleaseGIL() : _state(PyEval_SaveThread()) {}
66 PyEval_RestoreThread(_state);
71 PyThreadState *_state;
88#ifdef LIBCARLA_WITH_PYTHON_SUPPORT
103 template <
typename T>
105#ifdef LIBCARLA_WITH_PYTHON_SUPPORT
Inherit (privately) to suppress copy/move construction and assignment.
A deleter that can be passed to a smart pointer to acquire the GIL before destroying the object.
void operator()(T *ptr) const
A deleter that can be passed to a smart pointer to release the GIL before destroying the object.
void operator()(T *ptr) const
static bool ThisThreadHasTheGIL()
This file contains definitions of common data structures used in traffic manager.