diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-26 21:34:58 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-26 21:34:58 (GMT) |
commit | 8e4d4078183bfb262db3d8a5a5b26dbc79f56109 (patch) | |
tree | 4bcadc1928bda2f7de6b7bdc350d34411837adb9 /Include | |
parent | f3d77dc94ac733529be2b27d1e3cc8b7b29a5e62 (diff) | |
download | cpython-8e4d4078183bfb262db3d8a5a5b26dbc79f56109.zip cpython-8e4d4078183bfb262db3d8a5a5b26dbc79f56109.tar.gz cpython-8e4d4078183bfb262db3d8a5a5b26dbc79f56109.tar.bz2 |
PyGILState_Ensure(), PyGILState_Release(), PyGILState_GetThisThreadState() are
not available if Python is compiled without threads.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pystate.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Include/pystate.h b/Include/pystate.h index 50245c2..a894bb4 100644 --- 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. */ - char recursion_critical; /* The current calls must not cause - a stack overflow. */ + to handle the runtime error. */ + char recursion_critical; /* The current calls must not cause + a stack overflow. */ /* 'tracing' keeps track of the execution depth when tracing/profiling. This is to prevent the actual trace/profile code from being recorded in the trace/profile. */ @@ -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(PyGILState_STATE); */ 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. */ |