Commit 8e4d4078 authored by Victor Stinner's avatar Victor Stinner

PyGILState_Ensure(), PyGILState_Release(), PyGILState_GetThisThreadState() are

not available if Python is compiled without threads.
parent f3d77dc9
...@@ -158,6 +158,8 @@ typedef ...@@ -158,6 +158,8 @@ typedef
enum {PyGILState_LOCKED, PyGILState_UNLOCKED} enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
PyGILState_STATE; PyGILState_STATE;
#ifdef WITH_THREAD
/* Ensure that the current thread is ready to call the Python /* Ensure that the current thread is ready to call the Python
C API, regardless of the current state of Python, or of its C API, regardless of the current state of Python, or of its
thread lock. This may be called as many times as desired thread lock. This may be called as many times as desired
...@@ -199,6 +201,8 @@ PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE); ...@@ -199,6 +201,8 @@ PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE);
*/ */
PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void); PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);
#endif /* #ifdef WITH_THREAD */
/* The implementation of sys._current_frames() Returns a dict mapping /* The implementation of sys._current_frames() Returns a dict mapping
thread id to that thread's current frame. thread id to that thread's current frame.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment