@@ -11,8 +11,12 @@ extern "C" {
11
11
#include "pycore_atomic.h"
12
12
#include "pythread.h"
13
13
14
+ struct _is ; // See PyInterpreterState in cpython/pystate.h.
15
+
16
+ PyAPI_FUNC (int ) _Py_AddPendingCall (struct _is * , unsigned long , int (* )(void * ), void * );
17
+ PyAPI_FUNC (int ) _Py_MakePendingCalls (struct _is * );
18
+
14
19
struct _pending_calls {
15
- unsigned long main_thread ;
16
20
PyThread_type_lock lock ;
17
21
/* Request for running pending calls. */
18
22
_Py_atomic_int calls_to_do ;
@@ -22,13 +26,21 @@ struct _pending_calls {
22
26
int async_exc ;
23
27
#define NPENDINGCALLS 32
24
28
struct {
29
+ unsigned long thread_id ;
25
30
int (* func )(void * );
26
31
void * arg ;
27
32
} calls [NPENDINGCALLS ];
28
33
int first ;
29
34
int last ;
30
35
};
31
36
37
+ struct _ceval_interpreter_state {
38
+ /* This single variable consolidates all requests to break out of
39
+ the fast path in the eval loop. */
40
+ _Py_atomic_int eval_breaker ;
41
+ struct _pending_calls pending ;
42
+ };
43
+
32
44
#include "pycore_gil.h"
33
45
34
46
struct _ceval_runtime_state {
@@ -39,12 +51,8 @@ struct _ceval_runtime_state {
39
51
c_tracefunc. This speeds up the if statement in
40
52
PyEval_EvalFrameEx() after fast_next_opcode. */
41
53
int tracing_possible ;
42
- /* This single variable consolidates all requests to break out of
43
- the fast path in the eval loop. */
44
- _Py_atomic_int eval_breaker ;
45
54
/* Request for dropping the GIL */
46
55
_Py_atomic_int gil_drop_request ;
47
- struct _pending_calls pending ;
48
56
/* Request for checking signals. */
49
57
_Py_atomic_int signals_pending ;
50
58
struct _gil_runtime_state gil ;
0 commit comments