Skip to content
Myr

Make sure to init key and dbl_key also on win32

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Hopefully fixes page fault for mingw build Related to #2831

authored by Mattias Wadman · committed by Nico Williams · parent 765a5c7 · Browse files · 1 file+0 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+0 added−6 removed

  • other:+0 added−6 removed

1 file+0 added−6 removed

modified:src/jv.c-6 removed
488 unmodified lines
489#endif490491static pthread_key_t dec_ctx_key;492static pthread_key_t dec_ctx_dbl_key;493#ifndef WIN32493static pthread_once_t dec_ctx_once = PTHREAD_ONCE_INIT;495#endif494495#define DEC_CONTEXT() tsd_dec_ctx_get(&dec_ctx_key)496#define DEC_CONTEXT_TO_DOUBLE() tsd_dec_ctx_get(&dec_ctx_dbl_key)497
14 unmodified lines
512 if (pthread_key_create(&dec_ctx_dbl_key, jv_mem_free) != 0) {513 fprintf(stderr, "error: cannot create thread specific key");514 abort();515 }518#ifndef WIN32516 atexit(jv_tsd_dec_ctx_fini);520#endif517}518519static decContext* tsd_dec_ctx_get(pthread_key_t *key) {524#ifndef WIN32520 pthread_once(&dec_ctx_once, jv_tsd_dec_ctx_init); // cannot fail526#endif521 decContext *ctx = (decContext*)pthread_getspecific(*key);522 if (ctx) {523 return ctx;524 }
1459 unmodified lines