diff options
author | Max Maischein <corion@corion.net> | 2009-12-17 23:22:39 +0100 |
---|---|---|
committer | Jan Dubois <jand@activestate.com> | 2009-12-17 15:32:44 -0800 |
commit | 8703a9a4fd75723318bc4ba1afc42a215806f2d1 (patch) | |
tree | d85a5c22446075dab50cf156f9a8b2c3c75ca117 /util.c | |
parent | 229c5935ba2b931e7f367cc5b2706adeee57ee47 (diff) | |
download | perl-8703a9a4fd75723318bc4ba1afc42a215806f2d1.tar.gz |
Correct some #ifdef USE_ITHREADS / USE_MULTI
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -5837,9 +5837,13 @@ Perl_my_cxt_init(pTHX_ int *index, size_t size) PERL_ARGS_ASSERT_MY_CXT_INIT; if (*index == -1) { /* this module hasn't been allocated an index yet */ +#if defined(USE_ITHREADS) MUTEX_LOCK(&PL_my_ctx_mutex); +#endif *index = PL_my_cxt_index++; +#if defined(USE_ITHREADS) MUTEX_UNLOCK(&PL_my_ctx_mutex); +#endif } /* make sure the array is big enough */ @@ -5894,9 +5898,13 @@ Perl_my_cxt_init(pTHX_ const char *my_cxt_key, size_t size) index = Perl_my_cxt_index(aTHX_ my_cxt_key); if (index == -1) { /* this module hasn't been allocated an index yet */ +#if defined(USE_ITHREADS) MUTEX_LOCK(&PL_my_ctx_mutex); +#endif index = PL_my_cxt_index++; +#if defined(USE_ITHREADS) MUTEX_UNLOCK(&PL_my_ctx_mutex); +#endif } /* make sure the array is big enough */ |