summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2007-04-15 21:10:55 +0000
committerDave Mitchell <davem@fdisolutions.com>2007-04-15 21:10:55 +0000
commitb7185faf27223edfa3fad21c87d7dbf476059a5f (patch)
treecfdbf7777fc70a600b89b249d00fce7d7f018cfe /sv.c
parente4c5322dee1b8e87ff0e7aee20effad846301447 (diff)
downloadperl-b7185faf27223edfa3fad21c87d7dbf476059a5f.tar.gz
follow PL_watchaddr when cloning a thread
p4raw-id: //depot/perl@30963
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index c194ab3710..c5508cd0f3 100644
--- a/sv.c
+++ b/sv.c
@@ -11462,8 +11462,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_maxscream = -1; /* reinits on demand */
PL_lastscream = NULL;
- PL_watchaddr = NULL;
- PL_watchok = NULL;
PL_regdummy = proto_perl->Tregdummy;
PL_colorset = 0; /* reinits PL_colors[] */
@@ -11476,6 +11474,16 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_stashcache = newHV();
+ PL_watchaddr = (char **) ptr_table_fetch(PL_ptr_table,
+ proto_perl->Twatchaddr);
+ PL_watchok = PL_watchaddr ? * PL_watchaddr : NULL;
+ if (PL_debug && PL_watchaddr) {
+ PerlIO_printf(Perl_debug_log,
+ "WATCHING: %"UVxf" cloned as %"UVxf" with value %"UVxf"\n",
+ PTR2UV(proto_perl->Twatchaddr), PTR2UV(PL_watchaddr),
+ PTR2UV(PL_watchok));
+ }
+
if (!(flags & CLONEf_KEEP_PTR_TABLE)) {
ptr_table_free(PL_ptr_table);
PL_ptr_table = NULL;