This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
new thread should set current interp in TLS
authorGurusamy Sarathy <gsar@cpan.org>
Thu, 26 Aug 1999 23:53:33 +0000 (23:53 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Thu, 26 Aug 1999 23:53:33 +0000 (23:53 +0000)
p4raw-id: //depot/perl@4032

ext/Thread/Thread.xs

index ad99e2c..772d41a 100644 (file)
@@ -86,9 +86,14 @@ threadstart(void *arg)
     I32 oldscope = PL_scopestack_ix;
     I32 retval;
     SV *sv;
-    AV *av = newAV();
+    AV *av;
     int i, ret;
     dJMPENV;
+
+#if defined(MULTIPLICITY)
+    PERL_SET_INTERP(thr->interp);
+#endif
+
     DEBUG_S(PerlIO_printf(PerlIO_stderr(), "new thread %p waiting to start\n",
                          thr));
 
@@ -114,6 +119,7 @@ threadstart(void *arg)
     DEBUG_S(PerlIO_printf(PerlIO_stderr(), "new thread %p starting at %s\n",
                          thr, SvPEEK(TOPs)));
 
+    av = newAV();
     sv = POPs;
     PUTBACK;
     ENTER;