avoid the circular refcnt logic in magic_mutexfree()
Gurusamy Sarathy [Sun, 25 Oct 1998 04:49:04 +0000 (04:49 +0000)]
p4raw-id: //depot/perl@2052

mg.c
pp.c
pp_hot.c

diff --git a/mg.c b/mg.c
index f3fc7d7..49ad9be 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -2007,7 +2007,6 @@ magic_mutexfree(SV *sv, MAGIC *mg)
        croak("panic: magic_mutexfree");
     MUTEX_DESTROY(MgMUTEXP(mg));
     COND_DESTROY(MgCONDP(mg));
-    SvREFCNT_dec(sv);
     return 0;
 }
 #endif /* USE_THREADS */
diff --git a/pp.c b/pp.c
index 430e7a2..0bd3a23 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -4783,7 +4783,6 @@ PP(pp_lock)
        DEBUG_S(PerlIO_printf(PerlIO_stderr(), "0x%lx: pp_lock lock 0x%lx\n",
                              (unsigned long)thr, (unsigned long)sv);)
        MUTEX_UNLOCK(MgMUTEXP(mg));
-       SvREFCNT_inc(sv);       /* keep alive until magic_mutexfree */
        save_destructor(unlock_condpair, sv);
     }
 #endif /* USE_THREADS */
index 89bbba7..e59867e 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2110,7 +2110,6 @@ PP(pp_entersub)
            DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: pp_entersub lock %p\n",
                                  thr, sv);)
            MUTEX_UNLOCK(MgMUTEXP(mg));
-           SvREFCNT_inc(sv);   /* Keep alive until magic_mutexfree */
            save_destructor(unlock_condpair, sv);
        }
        MUTEX_LOCK(CvMUTEXP(cv));