summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 3234be31b0..86dd10f379 100644
--- a/pp.c
+++ b/pp.c
@@ -4296,4 +4296,20 @@ PP(pp_lock)
RETURN;
}
-
+PP(pp_specific)
+{
+#ifdef USE_THREADS
+ djSP;
+ SV **svp = av_fetch(thr->magicals, op->op_targ, FALSE);
+ if (!svp)
+ croak("panic: pp_specific");
+ EXTEND(sp, 1);
+ if (op->op_private & OPpLVAL_INTRO)
+ PUSHs(save_svref(svp));
+ else
+ PUSHs(*svp);
+#else
+ DIE("tried to access thread-specific data in non-threaded perl");
+#endif /* USE_THREADS */
+ RETURN;
+}