summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-13 18:01:27 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-13 18:01:27 +0000
commit458fb5819c1ac395635ee1129f0f694cb0128ffd (patch)
tree123f1ed4ff91c494e3a36366f37f2cf0fbb87c06 /pp_hot.c
parentc09156bb55f832ab6700e99026187942841f0ae4 (diff)
downloadperl-458fb5819c1ac395635ee1129f0f694cb0128ffd.tar.gz
Rewrite thread return code to distinguish between ordinary return
and die() and make join propagate the die. Add tiny method eval which just does "return eval { shift->join; }". Add Thread::Specific class for access to thread specific user data along with specific.t. Rename Class to classname throughout Thread.xs for consistency. Fix pp_specific to pp_threadsv in global.sym. Add support to pp_entersub in pp_hot.c to lock stash for static locked methods. p4raw-id: //depot/perl@248
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index b3545407e5..6dbc25951e 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1834,9 +1834,10 @@ PP(pp_entersub)
#ifdef USE_THREADS
/*
* First we need to check if the sub or method requires locking.
- * If so, we gain a lock on the CV or the first argument, as
- * appropriate. This has to be inline because for FAKE_THREADS,
- * COND_WAIT inlines code to reschedule by returning a new op.
+ * If so, we gain a lock on the CV, the first argument or the
+ * stash (for static methods), as appropriate. This has to be
+ * inline because for FAKE_THREADS, COND_WAIT inlines code to
+ * reschedule by returning a new op.
*/
MUTEX_LOCK(CvMUTEXP(cv));
if (CvFLAGS(cv) & CVf_LOCKED) {
@@ -1850,6 +1851,11 @@ PP(pp_entersub)
}
if (SvROK(sv))
sv = SvRV(sv);
+ else {
+ STRLEN len;
+ char *stashname = SvPV(sv, len);
+ sv = (SV*)gv_stashpvn(stashname, len, TRUE);
+ }
}
else {
sv = (SV*)cv;