diff options
author | Mattias Wadman <mattias.wadman@gmail.com> | 2023-08-10 19:13:58 +0200 |
---|---|---|
committer | Nico Williams <nico@cryptonector.com> | 2023-08-10 13:06:03 -0500 |
commit | 5a52553a3be6ef3e44928cab20f96cdaa3e8b5dc (patch) | |
tree | c00ad020b914a83031e1195d7d6eaa3f8845beb6 /src | |
parent | 765a5c77eb919bca04a20c000b8a1df65f8d81eb (diff) |
Make sure to init key and dbl_key also on win32
Hopefully fixes page fault for mingw build
Related to #2831
Diffstat (limited to 'src')
-rw-r--r-- | src/jv.c | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -490,9 +490,7 @@ pthread_getspecific(pthread_key_t key) static pthread_key_t dec_ctx_key; static pthread_key_t dec_ctx_dbl_key; -#ifndef WIN32 static pthread_once_t dec_ctx_once = PTHREAD_ONCE_INIT; -#endif #define DEC_CONTEXT() tsd_dec_ctx_get(&dec_ctx_key) #define DEC_CONTEXT_TO_DOUBLE() tsd_dec_ctx_get(&dec_ctx_dbl_key) @@ -515,15 +513,11 @@ void jv_tsd_dec_ctx_init() { fprintf(stderr, "error: cannot create thread specific key"); abort(); } -#ifndef WIN32 atexit(jv_tsd_dec_ctx_fini); -#endif } static decContext* tsd_dec_ctx_get(pthread_key_t *key) { -#ifndef WIN32 pthread_once(&dec_ctx_once, jv_tsd_dec_ctx_init); // cannot fail -#endif decContext *ctx = (decContext*)pthread_getspecific(*key); if (ctx) { return ctx; |