(original) (raw)

changeset: 69584:75503c26a17f user: Victor Stinner victor.stinner@haypocalc.com date: Tue Apr 26 23:34:58 2011 +0200 files: Include/pystate.h description: PyGILState_Ensure(), PyGILState_Release(), PyGILState_GetThisThreadState() are not available if Python is compiled without threads. diff -r a1c99fd58049 -r 75503c26a17f Include/pystate.h --- a/Include/pystate.h Tue Apr 26 13:59:59 2011 -0700 +++ b/Include/pystate.h Tue Apr 26 23:34:58 2011 +0200 @@ -73,9 +73,9 @@ 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 @@ 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(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. */ /victor.stinner@haypocalc.com