Alexandria  2.22.0
Please provide a description of the project.
GIL.h
Go to the documentation of this file.
1 
19 #ifndef PYSTON_GIL_H
20 #define PYSTON_GIL_H
21 
22 #include <Python.h>
23 
24 namespace Pyston {
25 
29 class GILLocker {
30 public:
31  GILLocker();
32 
33  ~GILLocker();
34 
35  static size_t getLockCount();
36 
37 protected:
38  PyGILState_STATE m_state;
39  friend class GILReleaser;
40 };
41 
45 class GILReleaser {
46 public:
47  explicit GILReleaser(PyGILState_STATE& state);
48 
49  explicit GILReleaser(GILLocker&);
50 
51  ~GILReleaser();
52 
53 protected:
54  PyGILState_STATE& m_state;
55 };
56 
57 } // end of namespace Pyston
58 
59 #endif // PYSTON_GIL_H
PyGILState_STATE m_state
Definition: GIL.h:38
static size_t getLockCount()
Definition: GIL.cpp:34
PyGILState_STATE & m_state
Definition: GIL.h:54
GILReleaser(PyGILState_STATE &state)
Definition: GIL.cpp:38