diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-11-08 11:19:18 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-11-08 11:19:18 +0000 |
commit | 5c831c245cbd15531aac8207bd2cc7d8bf7a2bab (patch) | |
tree | 39fa82fc7184d46ea244c180e68f4c4b813dfc56 /util.c | |
parent | 3352bfcb1116ab429a5d6310d2803aabbed4237e (diff) | |
download | perl-5c831c245cbd15531aac8207bd2cc7d8bf7a2bab.tar.gz |
more thorough cleanup in perl_destroy()
p4raw-id: //depot/perl@4537
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 20 |
1 files changed, 5 insertions, 15 deletions
@@ -3376,8 +3376,6 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t) Zero(thr, 1, struct perl_thread); #endif - PL_protect = MEMBER_TO_FPTR(Perl_default_protect); - thr->oursv = sv; init_stacks(); @@ -3390,18 +3388,7 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t) thr->flags = THRf_R_JOINABLE; MUTEX_INIT(&thr->mutex); - /* top_env needs to be non-zero. It points to an area - in which longjmp() stuff is stored, as C callstack - info there at least is thread specific this has to - be per-thread. Otherwise a 'die' in a thread gives - that thread the C stack of last thread to do an eval {}! - See comments in scope.h - Initialize top entry (as in perl.c for main thread) - */ - PL_start_env.je_prev = NULL; - PL_start_env.je_ret = -1; - PL_start_env.je_mustcatch = TRUE; - PL_top_env = &PL_start_env; + JMPENV_BOOTSTRAP; PL_in_eval = EVAL_NULL; /* ~(EVAL_INEVAL|EVAL_WARNONLY|EVAL_KEEPERR) */ PL_restartop = 0; @@ -3441,9 +3428,12 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t) PL_ofs = savepvn(t->Tofs, PL_ofslen); PL_defoutgv = (GV*)SvREFCNT_inc(t->Tdefoutgv); PL_chopset = t->Tchopset; - PL_formtarget = newSVsv(t->Tformtarget); PL_bodytarget = newSVsv(t->Tbodytarget); PL_toptarget = newSVsv(t->Ttoptarget); + if (t->Tformtarget == t->Ttoptarget) + PL_formtarget = PL_toptarget; + else + PL_formtarget = PL_bodytarget; /* Initialise all per-thread SVs that the template thread used */ svp = AvARRAY(t->threadsv); |