Change 30963 by [EMAIL PROTECTED] on 2007/04/15 21:10:55

        follow PL_watchaddr when cloning a thread

Affected files ...

... //depot/perl/sv.c#1384 edit

Differences ...

==== //depot/perl/sv.c#1384 (text) ====
Index: perl/sv.c
--- perl/sv.c#1383~30962~       2007-04-15 09:32:42.000000000 -0700
+++ perl/sv.c   2007-04-15 14:10:55.000000000 -0700
@@ -11462,8 +11462,6 @@
     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 @@
 
     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;
End of Patch.

Reply via email to