MADARA  3.4.1
Acquire_GIL.h
Go to the documentation of this file.
1 
2 #ifdef _MADARA_PYTHON_CALLBACKS_
3 
4 #ifndef _MADARA_PYTHON_ACQUIRE_GIL_H_
5 #define _MADARA_PYTHON_ACQUIRE_GIL_H_
6 
7 #include <boost/python.hpp>
8 
16 namespace madara
17 {
18 namespace python
19 {
25 {
26 public:
28  {
29  state_ = PyGILState_Ensure();
30  }
31 
33  {
34  PyGILState_Release(state_);
35  }
36 
37 private:
38  PyGILState_STATE state_;
39 };
40 }
41 }
42 #endif // not defined _MADARA_PYTHON_ACQUIRE_GIL_H_
43 
44 #endif // defined _MADARA_PYTHON_CALLBACKS_
This class encapsulates accessing the global interpreter lock.
Definition: Acquire_GIL.h:25
PyGILState_STATE state_
Definition: Acquire_GIL.h:38
Copyright(c) 2020 Galois.