Alexandria 2.25.0
SDC-CH common library for the Euclid project
GIL.cpp
Go to the documentation of this file.
1
19#include "Pyston/GIL.h"
20
21namespace Pyston {
22
23static size_t s_lock_count = 0;
24
26 m_state = PyGILState_Ensure();
28}
29
31 PyGILState_Release(m_state);
32}
33
35 return s_lock_count;
36}
37
38GILReleaser::GILReleaser(PyGILState_STATE& state) : m_state(state) {
39 PyGILState_Release(m_state);
40}
41
42GILReleaser::GILReleaser(GILLocker& locker) : m_state(locker.m_state) {
43 PyGILState_Release(m_state);
44}
45
47 m_state = PyGILState_Ensure();
49}
50
51} // end of namespace Pyston
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
static size_t s_lock_count
Definition: GIL.cpp:23