2 /* Thread and interpreter state structures and their interfaces */
11 /* State shared between threads */
13 struct _ts
; /* Forward */
14 struct _is
; /* Forward */
19 struct _ts
*tstate_head
;
30 /* State unique per thread */
32 struct _frame
; /* Avoid including frameobject.h */
37 PyInterpreterState
*interp
;
44 PyObject
*sys_profilefunc
;
45 PyObject
*sys_tracefunc
;
47 PyObject
*curexc_type
;
48 PyObject
*curexc_value
;
49 PyObject
*curexc_traceback
;
53 PyObject
*exc_traceback
;
57 /* XXX signal handlers should also be here */
62 DL_IMPORT(PyInterpreterState
*) PyInterpreterState_New(void);
63 DL_IMPORT(void) PyInterpreterState_Clear(PyInterpreterState
*);
64 DL_IMPORT(void) PyInterpreterState_Delete(PyInterpreterState
*);
66 DL_IMPORT(PyThreadState
*) PyThreadState_New(PyInterpreterState
*);
67 DL_IMPORT(void) PyThreadState_Clear(PyThreadState
*);
68 DL_IMPORT(void) PyThreadState_Delete(PyThreadState
*);
70 DL_IMPORT(void) PyThreadState_DeleteCurrent(void);
73 DL_IMPORT(PyThreadState
*) PyThreadState_Get(void);
74 DL_IMPORT(PyThreadState
*) PyThreadState_Swap(PyThreadState
*);
75 DL_IMPORT(PyObject
*) PyThreadState_GetDict(void);
78 /* Variable and macro for in-line access to current thread state */
80 extern DL_IMPORT(PyThreadState
*) _PyThreadState_Current
;
83 #define PyThreadState_GET() PyThreadState_Get()
85 #define PyThreadState_GET() (_PyThreadState_Current)
91 #endif /* !Py_PYSTATE_H */