summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-10-31 18:05:31 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-10-31 18:05:31 +0000
commita863c7d16499251f020c5d26d232aa865fa0b197 (patch)
tree9a4ae00010863431f84e1aa26d6e2cefe89dd514 /pp.c
parent46930d8f1568c61dcd2ab37f6a2924dc79596ffc (diff)
downloadperl-a863c7d16499251f020c5d26d232aa865fa0b197.tar.gz
Half way through moving per-thread magicals into per-thread fields
and the associated new OP_SPECIFIC and find_thread_magical stuff. perl will compile but plenty of the magicals are still broken. p4raw-id: //depot/perl@195
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 649506fa89..981e4889e2 100644
--- a/pp.c
+++ b/pp.c
@@ -396,7 +396,6 @@ SV* sv;
else if (SvPADTMP(sv))
sv = newSVsv(sv);
else {
- dTHR; /* just for SvREFCNT_inc */
SvTEMP_off(sv);
(void)SvREFCNT_inc(sv);
}
@@ -4296,3 +4295,15 @@ PP(pp_lock)
SETs(retsv);
RETURN;
}
+
+PP(pp_specific)
+{
+#ifdef USE_THREADS
+ dSP;
+ SV **svp = av_fetch(thr->specific, op->op_targ, TRUE);
+ XPUSHs(svp ? *svp : &sv_undef);
+#else
+ DIE("tried to access thread-specific data in non-threaded perl");
+#endif /* USE_THREADS */
+ RETURN;
+}