mirror of
https://github.com/python/cpython.git
synced 2024-11-29 04:44:13 +08:00
Add macro version of PyThreadState_GET(). This uses
_PyThreadState_Current, defined in pystate.c.
This commit is contained in:
parent
18bc7c2276
commit
275ea67e6b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user