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..)
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",
PUTBACK;
/* On your marks... */
+ SET_THR(savethread);
MUTEX_LOCK(&thr->mutex);
#ifdef THREAD_CREATE
}
# create a thread passing args and immedaietly wait for it.
-my $t = new Thread \&content,("ok 2\n","ok 3\n");
+my $t = new Thread \&content,("ok 2\n","ok 3\n", 1..1000);
print $t->join;
# check that lock works ...