File tree 3 files changed +16
-7
lines changed
3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,21 @@ extern "C" {
9
9
#endif
10
10
11
11
12
+ #if defined(HAVE_PTHREAD_STUBS )
13
+ // pthread_key
14
+ struct py_stub_tls_entry {
15
+ bool in_use ;
16
+ void * value ;
17
+ };
18
+ #endif
19
+
12
20
struct _pythread_runtime_state {
13
21
int initialized ;
22
+ #if defined(HAVE_PTHREAD_STUBS )
23
+ struct {
24
+ struct py_stub_tls_entry tls_entries [PTHREAD_KEYS_MAX ];
25
+ } stub ;
26
+ #endif
14
27
};
15
28
16
29
Original file line number Diff line number Diff line change @@ -124,13 +124,10 @@ pthread_attr_destroy(pthread_attr_t *attr)
124
124
return 0 ;
125
125
}
126
126
127
- // pthread_key
128
- typedef struct {
129
- bool in_use ;
130
- void * value ;
131
- } py_tls_entry ;
132
127
133
- static py_tls_entry py_tls_entries [PTHREAD_KEYS_MAX ] = {0 };
128
+ typedef struct py_stub_tls_entry py_tls_entry ;
129
+
130
+ #define py_tls_entries (_PyRuntime.threads.stub.tls_entries)
134
131
135
132
int
136
133
pthread_key_create (pthread_key_t * key , void (* destr_function )(void * ))
Original file line number Diff line number Diff line change @@ -325,7 +325,6 @@ Python/perf_trampoline.c - perf_status -
325
325
Python/perf_trampoline.c - extra_code_index -
326
326
Python/perf_trampoline.c - code_arena -
327
327
Python/perf_trampoline.c - trampoline_api -
328
- Python/thread_pthread_stubs.h - py_tls_entries -
329
328
330
329
331
330
# #################################
You can’t perform that action at this time.
0 commit comments