From c4e7bd8d7008b59d7502296f4da5ed2d4592e5f9 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Sun, 28 Mar 1999 03:37:23 +0000 Subject: integrate change#3179 from maint-5.005 p4raw-link: @3179 on //depot/maint-5.005/perl: 3c798f74a641ef1819699fe5d5c156d30ad033bc p4raw-id: //depot/perl@3181 p4raw-integrated: from //depot/maint-5.005/perl@3180 'merge in' t/lib/thread.t (@1649..) ext/Thread/Thread.xs (@2543..) --- ext/Thread/Thread.xs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ext/Thread') diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs index 543ecf00cf..c3b468314a 100644 --- a/ext/Thread/Thread.xs +++ b/ext/Thread/Thread.xs @@ -238,6 +238,11 @@ newthread (SV *startsv, AV *initargs, char *classname) savethread = thr; thr = new_struct_thread(thr); + /* temporarily pretend to be the child thread in case the + * XPUSHs() below want to grow the child's stack. This is + * safe, since the other thread is not yet created, and we + * are the only ones who know about it */ + SET_THR(thr); SPAGAIN; DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: newthread (%p), tid is %u, preparing stack\n", @@ -251,6 +256,7 @@ newthread (SV *startsv, AV *initargs, char *classname) PUTBACK; /* On your marks... */ + SET_THR(savethread); MUTEX_LOCK(&thr->mutex); #ifdef THREAD_CREATE -- cgit v1.2.1