From: Dave Mitchell Date: Sun, 15 Apr 2007 21:10:55 +0000 (+0000) Subject: follow PL_watchaddr when cloning a thread X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7185faf27223edfa3fad21c87d7dbf476059a5f;p=p5sagit%2Fp5-mst-13.2.git follow PL_watchaddr when cloning a thread p4raw-id: //depot/perl@30963 --- diff --git a/sv.c b/sv.c index c194ab3..c5508cd 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;