@@ -32,8 +32,12 @@ JL_DLLEXPORT void jl_threading_profile(void);
3232
3333#ifdef _OS_WINDOWS_
3434#define JL_HAVE_UCONTEXT
35- typedef win32_ucontext_t jl_ucontext_t ;
35+ typedef win32_ucontext_t jl_stack_context_t ;
36+ typedef jl_stack_context_t _jl_ucontext_t ;
3637#else
38+ typedef struct {
39+ jl_jmp_buf uc_mcontext ;
40+ } jl_stack_context_t ;
3741#if !defined(JL_HAVE_UCONTEXT ) && \
3842 !defined(JL_HAVE_ASM ) && \
3943 !defined(JL_HAVE_UNW_CONTEXT ) && \
@@ -56,13 +60,8 @@ typedef win32_ucontext_t jl_ucontext_t;
5660#endif
5761#endif
5862
59-
60- struct jl_stack_context_t {
61- jl_jmp_buf uc_mcontext ;
62- };
63-
6463#if (!defined(JL_HAVE_UNW_CONTEXT ) && defined(JL_HAVE_ASM )) || defined(JL_HAVE_SIGALTSTACK )
65- typedef struct jl_stack_context_t jl_ucontext_t ;
64+ typedef jl_stack_context_t _jl_ucontext_t ;
6665#endif
6766#if defined(JL_HAVE_ASYNCIFY )
6867#if defined(_COMPILER_TSAN_ENABLED_ )
@@ -75,19 +74,30 @@ typedef struct {
7574 // __asyncify_data struct.
7675 void * stackbottom ;
7776 void * stacktop ;
78- } jl_ucontext_t ;
77+ } _jl_ucontext_t ;
7978#endif
8079#if defined(JL_HAVE_UNW_CONTEXT )
8180#define UNW_LOCAL_ONLY
8281#include <libunwind.h>
83- typedef unw_context_t jl_ucontext_t ;
82+ typedef unw_context_t _jl_ucontext_t ;
8483#endif
8584#if defined(JL_HAVE_UCONTEXT )
8685#include <ucontext.h>
87- typedef ucontext_t jl_ucontext_t ;
86+ typedef ucontext_t _jl_ucontext_t ;
8887#endif
8988#endif
9089
90+ typedef struct {
91+ union {
92+ _jl_ucontext_t ctx ;
93+ jl_stack_context_t copy_ctx ;
94+ };
95+ #if defined(_COMPILER_TSAN_ENABLED_ )
96+ void * tsan_state ;
97+ #endif
98+ } jl_ucontext_t ;
99+
100+
91101// handle to reference an OS thread
92102#ifdef _OS_WINDOWS_
93103typedef DWORD jl_thread_t ;
@@ -225,13 +235,9 @@ typedef struct _jl_tls_states_t {
225235 void * stackbase ;
226236 size_t stacksize ;
227237 union {
228- jl_ucontext_t base_ctx ; // base context of stack
238+ _jl_ucontext_t base_ctx ; // base context of stack
229239 // This hack is needed to support always_copy_stacks:
230- #ifdef _OS_WINDOWS_
231- jl_ucontext_t copy_stack_ctx ;
232- #else
233- struct jl_stack_context_t copy_stack_ctx ;
234- #endif
240+ jl_stack_context_t copy_stack_ctx ;
235241 };
236242 // Temp storage for exception thrown in signal handler. Not rooted.
237243 struct _jl_value_t * sig_exception ;
0 commit comments