diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-10-31 18:05:31 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-10-31 18:05:31 +0000 |
commit | a863c7d16499251f020c5d26d232aa865fa0b197 (patch) | |
tree | 9a4ae00010863431f84e1aa26d6e2cefe89dd514 /ext | |
parent | 46930d8f1568c61dcd2ab37f6a2924dc79596ffc (diff) | |
download | perl-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 'ext')
-rw-r--r-- | ext/Thread/Thread.xs | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs index 7d309b6a2e..a6386176ff 100644 --- a/ext/Thread/Thread.xs +++ b/ext/Thread/Thread.xs @@ -204,38 +204,9 @@ char *class; #endif savethread = thr; - sv = newSVpv("", 0); - SvGROW(sv, sizeof(struct thread) + 1); - SvCUR_set(sv, sizeof(struct thread)); - thr = (Thread) SvPVX(sv); - DEBUG_L(PerlIO_printf(PerlIO_stderr(), "%p: newthread(%s) = %p)\n", - savethread, SvPEEK(startsv), thr)); - oursv = sv; - /* If we don't zero these foostack pointers, init_stacks won't init them */ - markstack = 0; - scopestack = 0; - savestack = 0; - retstack = 0; + thr = new_struct_thread(thr); init_stacks(ARGS); - curcop = savethread->Tcurcop; /* XXX As good a guess as any? */ SPAGAIN; - defstash = savethread->Tdefstash; /* XXX maybe these should */ - curstash = savethread->Tcurstash; /* always be set to main? */ - /* top_env? */ - /* runlevel */ - cvcache = newHV(); - thr->flags = THRf_R_JOINABLE; - MUTEX_INIT(&thr->mutex); - thr->tid = ++threadnum; - /* Insert new thread into the circular linked list and bump nthreads */ - MUTEX_LOCK(&threads_mutex); - thr->next = savethread->next; - thr->prev = savethread; - savethread->next = thr; - thr->next->prev = thr; - nthreads++; - MUTEX_UNLOCK(&threads_mutex); - DEBUG_L(PerlIO_printf(PerlIO_stderr(), "%p: newthread, tid is %u, preparing stack\n", savethread, thr->tid)); |