[Python-Dev] [Python-checkins] cpython: PyGILState_Ensure(), PyGILState_Release(), PyGILState_GetThisThreadState() are (original) (raw)
Jim Jewett jimjjewett at gmail.com
Thu Apr 28 02🔞35 CEST 2011
- Previous message: [Python-Dev] Socket servers in the test suite
- Next message: [Python-Dev] [Python-checkins] cpython: PyGILState_Ensure(), PyGILState_Release(), PyGILState_GetThisThreadState() are
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Would it be a problem to make them available a no-ops?
On 4/26/11, victor.stinner <python-checkins at python.org> wrote:
http://hg.python.org/cpython/rev/75503c26a17f changeset: 69584:75503c26a17f user: Victor Stinner <victor.stinner at haypocalc.com> date: Tue Apr 26 23:34:58 2011 +0200 summary: PyGILStateEnsure(), PyGILStateRelease(), PyGILStateGetThisThreadState() are not available if Python is compiled without threads.
files: Include/pystate.h | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/Include/pystate.h b/Include/pystate.h --- a/Include/pystate.h +++ b/Include/pystate.h @@ -73,9 +73,9 @@ struct frame *frame; int recursiondepth; char overflowed; /* The stack has overflowed. Allow 50 more calls - to handle the runtime error. */ - char recursioncritical; /* The current calls must not cause - a stack overflow. */ + to handle the runtime error. */ + char recursioncritical; /* 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 {PyGILStateLOCKED, PyGILStateUNLOCKED} PyGILStateSTATE; +#ifdef WITHTHREAD + /* 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 @@ */ PyAPIFUNC(PyThreadState *) PyGILStateGetThisThreadState(void); +#endif /* #ifdef WITHTHREAD */ + /* The implementation of sys.currentframes() Returns a dict mapping thread id to that thread's current frame. */ -- Repository URL: http://hg.python.org/cpython
- Previous message: [Python-Dev] Socket servers in the test suite
- Next message: [Python-Dev] [Python-checkins] cpython: PyGILState_Ensure(), PyGILState_Release(), PyGILState_GetThisThreadState() are
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]