summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-11-08 11:19:18 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-11-08 11:19:18 +0000
commit5c831c245cbd15531aac8207bd2cc7d8bf7a2bab (patch)
tree39fa82fc7184d46ea244c180e68f4c4b813dfc56 /util.c
parent3352bfcb1116ab429a5d6310d2803aabbed4237e (diff)
downloadperl-5c831c245cbd15531aac8207bd2cc7d8bf7a2bab.tar.gz
more thorough cleanup in perl_destroy()
p4raw-id: //depot/perl@4537
Diffstat (limited to 'util.c')
-rw-r--r--util.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/util.c b/util.c
index fc8307d52c..7281fec862 100644
--- a/util.c
+++ b/util.c
@@ -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);