diff options
-rw-r--r-- | embedvar.h | 2 | ||||
-rw-r--r-- | ext/threads/t/join.t | 6 | ||||
-rw-r--r-- | perl.c | 7 | ||||
-rw-r--r-- | perlapi.h | 2 | ||||
-rw-r--r-- | perlvars.h | 4 | ||||
-rw-r--r-- | pod/perlintern.pod | 4 |
6 files changed, 18 insertions, 7 deletions
diff --git a/embedvar.h b/embedvar.h index 612ebdbe7a..bcf31c7647 100644 --- a/embedvar.h +++ b/embedvar.h @@ -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 diff --git a/ext/threads/t/join.t b/ext/threads/t/join.t index 892f48d055..230d70c545 100644 --- a/ext/threads/t/join.t +++ b/ext/threads/t/join.t @@ -1,4 +1,3 @@ - BEGIN { chdir 't' if -d 't'; @INC = '../lib'; @@ -30,6 +29,10 @@ sub ok { return $ok; } +sub skip { + ok(1, "# Skipped: @_"); +} + ok(1,""); @@ -89,7 +92,6 @@ ok(1,""); } 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 { @@ -155,6 +155,9 @@ perl_construct(pTHXx) /* 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 @@ -918,10 +921,6 @@ setuid perl scripts securely.\n"); 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); #else @@ -930,6 +930,8 @@ END_EXTERN_C #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 diff --git a/perlvars.h b/perlvars.h index 0299f8f53a..0495f1acfc 100644 --- a/perlvars.h +++ b/perlvars.h @@ -62,3 +62,7 @@ PERLVARI(Gthreadhook, thrhook_proc_t, MEMBER_TO_FPTR(Perl_nothreadhook)) #ifdef THREADS_HAVE_PIDS PERLVARI(Gppid, IV, 0) #endif + +#ifdef USE_ITHREADS +PERLVAR(Gdollarzero_mutex, perl_mutex) /* Modifying $0 */ +#endif diff --git a/pod/perlintern.pod b/pod/perlintern.pod index 0ec74e0816..ea5c902c0f 100644 --- a/pod/perlintern.pod +++ b/pod/perlintern.pod @@ -410,7 +410,9 @@ same package can be detected). SvCUR is sometimes hijacked to 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. |