Debian Codegraph @

pypy/module/cpyext/include/pystate.h

raw symbols SCIP
1 /* Thread and interpreter state structures and their interfaces */
2
3
4 #ifndef Py_PYSTATE_H
5 #define Py_PYSTATE_H
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 /* This limitation is for performance and simplicity. If needed it can be
11 removed (with effort). */
12 #define MAX_CO_EXTRA_USERS 255
13
14 /* Forward declarations for PyFrameObject, PyThreadState
15 and PyInterpreterState */
16 struct _ts;
17 struct _is;
18
19 typedef struct _is {
20 struct _is *next;
21 PyObject * modules_by_index;
22 } PyInterpreterState;
23
24 typedef struct _ts {
25 PyInterpreterState *interp;
26 PyObject *dict; /* Stores per-thread state */
27 uint64_t id;
28 } PyThreadState;
29
30 enum {PyGILState_LOCKED, PyGILState_UNLOCKED};
31 typedef int PyGILState_STATE;
32
33 #define PyThreadState_GET() PyThreadState_Get()
34 PyAPI_FUNC(PyObject*) PyState_FindModule(struct PyModuleDef*);
35 PyAPI_FUNC(PyInterpreterState*) PyThreadState_GetInterpreter(PyThreadState *tstate);
36
37 #ifdef __cplusplus
38 }
39 #endif
40 #endif /* !Py_PYSTATE_H */