Do not unlock mutex twice.
Artur Bergman [Sun, 21 Apr 2002 23:29:22 +0000 (23:29 +0000)]
       Do not unlock mutex after it has been destroyed and freed.
       Do not email p5p without uncrossing eyes.

p4raw-id: //depot/perl@16056

ext/threads/threads.xs

index 0e19923..eea6d65 100755 (executable)
@@ -198,7 +198,9 @@ ithread_mg_free(pTHX_ SV *sv, MAGIC *mg)
             MUTEX_UNLOCK(&thread->mutex);
             Perl_ithread_destruct(aTHX_ thread, "no reference");
        }
-       MUTEX_UNLOCK(&thread->mutex);
+       else {
+           MUTEX_UNLOCK(&thread->mutex);
+       }    
     }
     else {
        MUTEX_UNLOCK(&thread->mutex);