cpython: 75503c26a17f (original) (raw)

Mercurial > cpython

changeset 69584:75503c26a17f

PyGILState_Ensure(), PyGILState_Release(), PyGILState_GetThisThreadState() are not available if Python is compiled without threads.

Victor Stinner victor.stinner@haypocalc.com
date Tue, 26 Apr 2011 23:34:58 +0200
parents a1c99fd58049
children 79fcd71d0356
files Include/pystate.h
diffstat 1 files changed, 7 insertions(+), 3 deletions(-)[+] [-] Include/pystate.h 10

line wrap: on

line diff

--- a/Include/pystate.h +++ b/Include/pystate.h @@ -73,9 +73,9 @@ typedef struct _ts { struct _frame frame; int recursion_depth; char overflowed; / The stack has overflowed. Allow 50 more calls - to handle the runtime error. */

@@ -158,6 +158,8 @@ typedef enum {PyGILState_LOCKED, PyGILState_UNLOCKED} PyGILState_STATE; +#ifdef WITH_THREAD + /* Ensure that the current thread is ready to call the Python C API, regardless of the current state of Python, or of its thread lock. This may be called as many times as desired @@ -199,6 +201,8 @@ PyAPI_FUNC(void) PyGILState_Release(PyGI */ PyAPI_FUNC(PyThreadState ) PyGILState_GetThisThreadState(void); +#endif / #ifdef WITH_THREAD / + / The implementation of sys._current_frames() Returns a dict mapping thread id to that thread's current frame. */