diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-01-20 10:19:46 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-01-20 10:19:46 (GMT) |
commit | b56837a03358ee2a3374fc0004488179c6771442 (patch) | |
tree | 59d848efeabdc78d807d2eb3c462635f7cf3876a /Include | |
parent | 5ccbf79eaea74814a16618879919ff470dc5131f (diff) | |
parent | bfd316e750bc3040c08d1b5872e2de188e8c1e5f (diff) | |
download | cpython-b56837a03358ee2a3374fc0004488179c6771442.zip cpython-b56837a03358ee2a3374fc0004488179c6771442.tar.gz cpython-b56837a03358ee2a3374fc0004488179c6771442.tar.bz2 |
Merge 3.5
Issue #26154: Add a new private _PyThreadState_UncheckedGet() function.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pystate.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Include/pystate.h b/Include/pystate.h index 6000b81..b50b16b 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -168,7 +168,17 @@ PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); PyAPI_FUNC(void) _PyGILState_Reinit(void); #endif +/* Return the current thread state. The global interpreter lock must be held. + * When the current thread state is NULL, this issues a fatal error (so that + * the caller needn't check for NULL). */ PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void); + +#ifdef WITH_THREAD +/* Similar to PyThreadState_Get(), but don't issue a fatal error + * if it is NULL. */ +PyAPI_FUNC(PyThreadState *) _PyThreadState_UncheckedGet(void); +#endif + PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *); PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void); PyAPI_FUNC(int) PyThreadState_SetAsyncExc(long, PyObject *); |