diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2015-11-05 18:57:58 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2015-11-23 06:55:12 -0500 |
commit | 80b94025b9e815d47202e20837e43322cf333651 (patch) | |
tree | 25f315bb8f80a8b323c392a609375344c5393328 /util.c | |
parent | e1fc825d560ba7ba910aba84fe4eca5e5a1f2b66 (diff) | |
download | perl-80b94025b9e815d47202e20837e43322cf333651.tar.gz |
annotate the mutex use of atfork_lock and atfork_unlock
util.c:2729:1: warning: mutex 'PL_perlio_mutex' is still held at the end of function [-Wthread-safety-analysis]
}
util.c:2729:1: warning: mutex 'PL_op_mutex' is still held at the end of function [-Wthread-safety-analysis]
}
util.c:2739:5: warning: releasing mutex 'PL_perlio_mutex' that was not held [-Wthread-safety-analysis]
MUTEX_UNLOCK(&PL_perlio_mutex);
util.c:2744:5: warning: releasing mutex 'PL_op_mutex' that was not held [-Wthread-safety-analysis]
OP_REFCNT_UNLOCK;
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -2714,6 +2714,15 @@ Perl_my_popen(pTHX_ const char *cmd, const char *mode) /* this is called in parent before the fork() */ void Perl_atfork_lock(void) +#if defined(USE_ITHREADS) +# ifdef USE_PERLIO + PERL_TSA_ACQUIRE(PL_perlio_mutex) +# endif +# ifdef MYMALLOC + PERL_TSA_ACQUIRE(PL_malloc_mutex) +# endif + PERL_TSA_ACQUIRE(PL_op_mutex) +#endif { #if defined(USE_ITHREADS) dVAR; @@ -2731,6 +2740,15 @@ Perl_atfork_lock(void) /* this is called in both parent and child after the fork() */ void Perl_atfork_unlock(void) +#if defined(USE_ITHREADS) +# ifdef USE_PERLIO + PERL_TSA_RELEASE(PL_perlio_mutex) +# endif +# ifdef MYMALLOC + PERL_TSA_RELEASE(PL_malloc_mutex) +# endif + PERL_TSA_RELEASE(PL_op_mutex) +#endif { #if defined(USE_ITHREADS) dVAR; |