File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,17 @@ extern "C" {
4646#endif
4747
4848
49+ #if defined(HAVE_PTHREAD_STUBS )
50+ // pthread_key
51+ struct py_stub_tls_entry {
52+ bool in_use ;
53+ void * value ;
54+ };
55+ #endif
56+
4957struct _pythread_runtime_state {
5058 int initialized ;
59+
5160#ifdef _USE_PTHREADS
5261 // This matches when thread_pthread.h is used.
5362 struct {
@@ -60,6 +69,12 @@ struct _pythread_runtime_state {
6069 } _condattr_monotonic ;
6170
6271#endif // USE_PTHREADS
72+
73+ #if defined(HAVE_PTHREAD_STUBS )
74+ struct {
75+ struct py_stub_tls_entry tls_entries [PTHREAD_KEYS_MAX ];
76+ } stub ;
77+ #endif
6378};
6479
6580
Original file line number Diff line number Diff line change @@ -124,13 +124,10 @@ pthread_attr_destroy(pthread_attr_t *attr)
124124 return 0 ;
125125}
126126
127- // pthread_key
128- typedef struct {
129- bool in_use ;
130- void * value ;
131- } py_tls_entry ;
132127
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)
134131
135132int
136133pthread_key_create (pthread_key_t * key , void (* destr_function )(void * ))
Original file line number Diff line number Diff line change @@ -317,7 +317,6 @@ Python/perf_trampoline.c - perf_status -
317317Python/perf_trampoline.c - extra_code_index -
318318Python/perf_trampoline.c - code_arena -
319319Python/perf_trampoline.c - trampoline_api -
320- Python/thread_pthread_stubs.h - py_tls_entries -
321320
322321
323322# #################################
You can’t perform that action at this time.
0 commit comments