This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
annotate the mutex use of S_more_refcounted_fds
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 5 Nov 2015 23:58:56 +0000 (18:58 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 23 Nov 2015 11:55:12 +0000 (06:55 -0500)
perlio.c:2232:2: warning: releasing mutex 'PL_perlio_mutex' that was not held [-Wthread-safety-analysis]
        MUTEX_UNLOCK(&PL_perlio_mutex);

perlio.c

index 8ab47e4..20a347e 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -2204,7 +2204,9 @@ PerlIOBase_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags)
 
 /* Must be called with PL_perlio_mutex locked. */
 static void
-S_more_refcounted_fds(pTHX_ const int new_fd) {
+S_more_refcounted_fds(pTHX_ const int new_fd)
+  PERL_TSA_REQUIRES(PL_perlio_mutex)
+{
     dVAR;
     const int old_max = PL_perlio_fd_refcnt_size;
     const int new_max = 16 + (new_fd & ~15);