Change 18239 by jhi@kosh on 2002/12/03 12:49:01
Fix up #18229.
Affected files ...
.... //depot/perl/embedvar.h#155 edit
.... //depot/perl/ext/threads/t/join.t#3 edit
.... //depot/perl/perl.c#460 edit
.... //depot/perl/perlapi.h#77 edit
.... //depot/perl/perlvars.h#46 edit
.... //depot/perl/pod/perlintern.pod#25 edit
Differences ...
==== //depot/perl/embedvar.h#155 (text+w) ====
Index: perl/embedvar.h
--- perl/embedvar.h#154~18188~ Tue Nov 26 17:32:52 2002
+++ perl/embedvar.h Tue Dec 3 04:49:01 2002
@@ -894,6 +894,7 @@
#define PL_Yes (PL_Vars.GYes)
#define PL_curinterp (PL_Vars.Gcurinterp)
#define PL_do_undump (PL_Vars.Gdo_undump)
+#define PL_dollarzero_mutex (PL_Vars.Gdollarzero_mutex)
#define PL_hexdigit (PL_Vars.Ghexdigit)
#define PL_lockhook (PL_Vars.Glockhook)
#define PL_malloc_mutex (PL_Vars.Gmalloc_mutex)
@@ -913,6 +914,7 @@
#define PL_GYes PL_Yes
#define PL_Gcurinterp PL_curinterp
#define PL_Gdo_undump PL_do_undump
+#define PL_Gdollarzero_mutex PL_dollarzero_mutex
#define PL_Ghexdigit PL_hexdigit
#define PL_Glockhook PL_lockhook
#define PL_Gmalloc_mutex PL_malloc_mutex
==== //depot/perl/ext/threads/t/join.t#3 (text) ====
Index: perl/ext/threads/t/join.t
--- perl/ext/threads/t/join.t#2~18229~ Mon Dec 2 07:43:16 2002
+++ perl/ext/threads/t/join.t Tue Dec 3 04:49:01 2002
@@ -1,4 +1,3 @@
-
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
@@ -30,6 +29,10 @@
return $ok;
}
+sub skip {
+ ok(1, "# Skipped: @_");
+}
+
ok(1,"");
@@ -89,7 +92,6 @@
}
if ($^O eq 'linux') { # We parse ps output so this is OS-dependent.
-
# First modify $0 in a subthread.
print "# 1a: \$0 = $0\n";
join( threads->new( sub {
==== //depot/perl/perl.c#460 (text) ====
Index: perl/perl.c
--- perl/perl.c#459~18229~ Mon Dec 2 07:43:16 2002
+++ perl/perl.c Tue Dec 3 04:49:01 2002
@@ -155,6 +155,9 @@
/* Init the real globals (and main thread)? */
if (!PL_linestr) {
+#ifdef USE_ITHREADS
+ MUTEX_INIT(&PL_dollarzero_mutex); /* for $0 modifying */
+#endif
#ifdef PERL_FLEXIBLE_EXCEPTIONS
PL_protect = MEMBER_TO_FPTR(Perl_default_protect); /* for exceptions */
#endif
@@ -917,10 +920,6 @@
time(&PL_basetime);
oldscope = PL_scopestack_ix;
PL_dowarn = G_WARN_OFF;
-
-#ifdef USE_ITHREADS
- MUTEX_INIT(&PL_dollarzero_mutex);
-#endif
#ifdef PERL_FLEXIBLE_EXCEPTIONS
CALLPROTECT(aTHX_ pcur_env, &ret, MEMBER_TO_FPTR(S_vparse_body), env, xsinit);
==== //depot/perl/perlapi.h#77 (text+w) ====
Index: perl/perlapi.h
--- perl/perlapi.h#76~18188~ Tue Nov 26 17:32:52 2002
+++ perl/perlapi.h Tue Dec 3 04:49:01 2002
@@ -930,6 +930,8 @@
#define PL_curinterp (*Perl_Gcurinterp_ptr(NULL))
#undef PL_do_undump
#define PL_do_undump (*Perl_Gdo_undump_ptr(NULL))
+#undef PL_dollarzero_mutex
+#define PL_dollarzero_mutex (*Perl_Gdollarzero_mutex_ptr(NULL))
#undef PL_hexdigit
#define PL_hexdigit (*Perl_Ghexdigit_ptr(NULL))
#undef PL_lockhook
==== //depot/perl/perlvars.h#46 (text) ====
Index: perl/perlvars.h
--- perl/perlvars.h#45~18030~ Sat Oct 19 07:10:21 2002
+++ perl/perlvars.h Tue Dec 3 04:49:01 2002
@@ -62,3 +62,7 @@
#ifdef THREADS_HAVE_PIDS
PERLVARI(Gppid, IV, 0)
#endif
+
+#ifdef USE_ITHREADS
+PERLVAR(Gdollarzero_mutex, perl_mutex) /* Modifying $0 */
+#endif
==== //depot/perl/pod/perlintern.pod#25 (text+w) ====
Index: perl/pod/perlintern.pod
--- perl/pod/perlintern.pod#24~18220~ Sun Dec 1 16:58:54 2002
+++ perl/pod/perlintern.pod Tue Dec 3 04:49:01 2002
@@ -410,7 +410,9 @@
store the generation number during compilation.
If SvFAKE is set on the name SV then slot in the frame AVs are
-a REFCNT'ed references to a lexical from "outside".
+a REFCNT'ed references to a lexical from "outside". In this case,
+the name SV does not have a cop_seq range, since it is in scope
+throughout.
If the 'name' is '&' the the corresponding entry in frame AV
is a CV representing a possible closure.
End of Patch.