summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-07-08 18:47:35 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-07-08 18:47:35 +0000
commit51371543ca1a75ed152020ad0846b5b8cf11c32f (patch)
tree9bfd9a21697b0769e2681483631c742642dd8c45 /pp_hot.c
parent4d61ec052de5c3a91dc64c80c032c2cbec44d845 (diff)
downloadperl-51371543ca1a75ed152020ad0846b5b8cf11c32f.tar.gz
more PERL_OBJECT cleanups (changes still untested on Unix!)
p4raw-id: //depot/perl@3660
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/pp_hot.c b/pp_hot.c
index f4ed17129c..81a4f5699f 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -34,25 +34,7 @@
/* Hot code. */
#ifdef USE_THREADS
-STATIC void
-S_unset_cvowner(pTHX_ void *cvarg)
-{
- register CV* cv = (CV *) cvarg;
-#ifdef DEBUGGING
- dTHR;
-#endif /* DEBUGGING */
-
- DEBUG_S((PerlIO_printf(PerlIO_stderr(), "%p unsetting CvOWNER of %p:%s\n",
- thr, cv, SvPEEK((SV*)cv))));
- MUTEX_LOCK(CvMUTEXP(cv));
- DEBUG_S(if (CvDEPTH(cv) != 0)
- PerlIO_printf(PerlIO_stderr(), "depth %ld != 0\n",
- CvDEPTH(cv)););
- assert(thr == CvOWNER(cv));
- CvOWNER(cv) = 0;
- MUTEX_UNLOCK(CvMUTEXP(cv));
- SvREFCNT_dec(cv);
-}
+static void unset_cvowner(pTHXo_ void *cvarg);
#endif /* USE_THREADS */
PP(pp_const)
@@ -2142,7 +2124,7 @@ try_autoload:
DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: pp_entersub lock %p\n",
thr, sv);)
MUTEX_UNLOCK(MgMUTEXP(mg));
- save_destructor(Perl_unlock_condpair, sv);
+ SAVEDESTRUCTOR(Perl_unlock_condpair, sv);
}
MUTEX_LOCK(CvMUTEXP(cv));
}
@@ -2187,7 +2169,7 @@ try_autoload:
CvOWNER(cv) = thr;
SvREFCNT_inc(cv);
if (CvDEPTH(cv) == 0)
- SAVEDESTRUCTOR(S_unset_cvowner, (void*) cv);
+ SAVEDESTRUCTOR(unset_cvowner, (void*) cv);
}
else {
/* (2) => grab ownership of cv. (3) => make clone */
@@ -2224,7 +2206,7 @@ try_autoload:
DEBUG_S(if (CvDEPTH(cv) != 0)
PerlIO_printf(PerlIO_stderr(), "depth %ld != 0\n",
CvDEPTH(cv)););
- SAVEDESTRUCTOR(S_unset_cvowner, (void*) cv);
+ SAVEDESTRUCTOR(unset_cvowner, (void*) cv);
}
}
#endif /* USE_THREADS */
@@ -2597,3 +2579,24 @@ PP(pp_method)
RETURN;
}
+#ifdef USE_THREADS
+static void
+unset_cvowner(pTHXo_ void *cvarg)
+{
+ register CV* cv = (CV *) cvarg;
+#ifdef DEBUGGING
+ dTHR;
+#endif /* DEBUGGING */
+
+ DEBUG_S((PerlIO_printf(PerlIO_stderr(), "%p unsetting CvOWNER of %p:%s\n",
+ thr, cv, SvPEEK((SV*)cv))));
+ MUTEX_LOCK(CvMUTEXP(cv));
+ DEBUG_S(if (CvDEPTH(cv) != 0)
+ PerlIO_printf(PerlIO_stderr(), "depth %ld != 0\n",
+ CvDEPTH(cv)););
+ assert(thr == CvOWNER(cv));
+ CvOWNER(cv) = 0;
+ MUTEX_UNLOCK(CvMUTEXP(cv));
+ SvREFCNT_dec(cv);
+}
+#endif /* USE_THREADS */