Alexandria
2.22.0
Please provide a description of the project.
Pyston
src
lib
GIL.cpp
Go to the documentation of this file.
1
19
#include "
Pyston/GIL.h
"
20
21
namespace
Pyston
{
22
23
static
size_t
s_lock_count
= 0;
24
25
GILLocker::GILLocker
() {
26
m_state
= PyGILState_Ensure();
27
++
s_lock_count
;
28
}
29
30
GILLocker::~GILLocker
() {
31
PyGILState_Release(
m_state
);
32
}
33
34
size_t
GILLocker::getLockCount
() {
35
return
s_lock_count
;
36
}
37
38
GILReleaser::GILReleaser
(PyGILState_STATE& state) : m_state(state) {
39
PyGILState_Release(
m_state
);
40
}
41
42
GILReleaser::GILReleaser
(
GILLocker
& locker) : m_state(locker.m_state) {
43
PyGILState_Release(
m_state
);
44
}
45
46
GILReleaser::~GILReleaser
() {
47
m_state
= PyGILState_Ensure();
48
++
s_lock_count
;
49
}
50
51
}
// end of namespace Pyston
GIL.h
Pyston::GILLocker
Definition:
GIL.h:29
Pyston::GILLocker::~GILLocker
~GILLocker()
Definition:
GIL.cpp:30
Pyston::GILLocker::m_state
PyGILState_STATE m_state
Definition:
GIL.h:38
Pyston::GILLocker::getLockCount
static size_t getLockCount()
Definition:
GIL.cpp:34
Pyston::GILLocker::GILLocker
GILLocker()
Definition:
GIL.cpp:25
Pyston::GILReleaser::~GILReleaser
~GILReleaser()
Definition:
GIL.cpp:46
Pyston::GILReleaser::m_state
PyGILState_STATE & m_state
Definition:
GIL.h:54
Pyston::GILReleaser::GILReleaser
GILReleaser(PyGILState_STATE &state)
Definition:
GIL.cpp:38
Pyston
Definition:
ExceptionRaiser.h:28
Pyston::s_lock_count
static size_t s_lock_count
Definition:
GIL.cpp:23
Generated by
1.9.1