Alexandria 2.25.0
SDC-CH common library for the Euclid 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
24namespace Pyston {
25
29class GILLocker {
30public:
31 GILLocker();
32
33 ~GILLocker();
34
35 static size_t getLockCount();
36
37protected:
38 PyGILState_STATE m_state;
39 friend class GILReleaser;
40};
41
46public:
47 explicit GILReleaser(PyGILState_STATE& state);
48
49 explicit GILReleaser(GILLocker&);
50
52
53protected:
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