Add macro version of PyThreadState_GET(). This uses

_PyThreadState_Current, defined in pystate.c.
This commit is contained in:
Guido van Rossum 1998-12-21 18:28:10 +00:00
parent 18bc7c2276
commit 275ea67e6b
1 changed files with 11 additions and 0 deletions

View File

@ -101,6 +101,17 @@ DL_IMPORT(PyThreadState *) PyThreadState_Get Py_PROTO((void));
DL_IMPORT(PyThreadState *) PyThreadState_Swap Py_PROTO((PyThreadState *));
DL_IMPORT(PyObject *) PyThreadState_GetDict Py_PROTO((void));
/* Variable and macro for in-line access to current thread state */
DL_IMPORT(PyThreadState *) _PyThreadState_Current;
#ifdef Py_DEBUG
#define PyThreadState_GET() PyThreadState_Get()
#else
#define PyThreadState_GET() (_PyThreadState_Current)
#endif
#ifdef __cplusplus
}
#endif