MADARA  3.2.3
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  {
24  class Acquire_GIL
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_
PyGILState_STATE state_
Definition: Acquire_GIL.h:38
This class encapsulates accessing the global interpreter lock.
Definition: Acquire_GIL.h:24
Copyright (c) 2015 Carnegie Mellon University.