This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
annotate S_ithread_free mutex use
authorJarkko Hietaniemi <jhi@iki.fi>
Fri, 6 Nov 2015 00:13:22 +0000 (19:13 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 23 Nov 2015 11:55:12 +0000 (06:55 -0500)
threads.xs:276:13: warning: releasing mutex 'thread->mutex' that was not held [-Wthread-safety-analysis]
                  MUTEX_UNLOCK(&thread->mutex);

threads.xs:282:5: warning: releasing mutex 'thread->mutex' that was not held [-Wthread-safety-analysis]
          MUTEX_UNLOCK(&thread->mutex);

threads.xs:394:1: warning: mutex 'thread->mutex' is still held at the end of
      function [-Wthread-safety-analysis]
}

threads.xs:677:1: warning: mutex 'thread->mutex' is still held at the end of
      function [-Wthread-safety-analysis]
}

dist/threads/threads.xs

index 366877e..10b0d9f 100644 (file)
@@ -264,6 +264,7 @@ S_ithread_clear(pTHX_ ithread *thread)
  */
 STATIC void
 S_ithread_free(pTHX_ ithread *thread)
+  PERL_TSA_RELEASE(thread->mutex)
 {
 #ifdef WIN32
     HANDLE handle;