File tree 3 files changed +9
-11
lines changed
3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -67,12 +67,12 @@ _Py_ThreadCanHandlePendingCalls(void)
67
67
static inline PyThreadState *
68
68
_PyRuntimeState_GetThreadState (_PyRuntimeState * runtime )
69
69
{
70
- return (PyThreadState * )_Py_atomic_load_relaxed (& runtime -> gilstate . tstate_current );
70
+ return (PyThreadState * )_Py_atomic_load_relaxed (& runtime -> tstate_current );
71
71
}
72
72
73
73
/* Get the current Python thread state.
74
74
75
- Efficient macro reading directly the 'gilstate. tstate_current' atomic
75
+ Efficient macro reading directly the 'tstate_current' atomic
76
76
variable. The macro is unsafe: it does not check for error and it can
77
77
return NULL.
78
78
Original file line number Diff line number Diff line change @@ -41,9 +41,6 @@ struct _gilstate_runtime_state {
41
41
/* bpo-26558: Flag to disable PyGILState_Check().
42
42
If set to non-zero, PyGILState_Check() always return 1. */
43
43
int check_enabled ;
44
- /* Assuming the current thread holds the GIL, this is the
45
- PyThreadState for the current thread. */
46
- _Py_atomic_address tstate_current ;
47
44
/* The single PyInterpreterState used by this process'
48
45
GILState implementation
49
46
*/
@@ -124,6 +121,10 @@ typedef struct pyruntimestate {
124
121
125
122
unsigned long main_thread ;
126
123
124
+ /* Assuming the current thread holds the GIL, this is the
125
+ PyThreadState for the current thread. */
126
+ _Py_atomic_address tstate_current ;
127
+
127
128
PyWideStringList orig_argv ;
128
129
129
130
struct _parser_runtime_state parser ;
Original file line number Diff line number Diff line change @@ -48,25 +48,22 @@ static inline PyThreadState *
48
48
current_fast_get (_PyRuntimeState * runtime )
49
49
{
50
50
// The GIL must be held by the current thread.
51
- return (PyThreadState * )_Py_atomic_load_relaxed (
52
- & runtime -> gilstate .tstate_current );
51
+ return (PyThreadState * )_Py_atomic_load_relaxed (& runtime -> tstate_current );
53
52
}
54
53
55
54
static inline void
56
55
current_fast_set (_PyRuntimeState * runtime , PyThreadState * tstate )
57
56
{
58
57
// The GIL must be held by the current thread.
59
58
assert (tstate != NULL );
60
- _Py_atomic_store_relaxed (& runtime -> gilstate .tstate_current ,
61
- (uintptr_t )tstate );
59
+ _Py_atomic_store_relaxed (& runtime -> tstate_current , (uintptr_t )tstate );
62
60
}
63
61
64
62
static inline void
65
63
current_fast_clear (_PyRuntimeState * runtime )
66
64
{
67
65
// The GIL must be held by the current thread.
68
- _Py_atomic_store_relaxed (& runtime -> gilstate .tstate_current ,
69
- (uintptr_t )NULL );
66
+ _Py_atomic_store_relaxed (& runtime -> tstate_current , (uintptr_t )NULL );
70
67
}
71
68
72
69
You can’t perform that action at this time.
0 commit comments