This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix errors in new MY_CTX code
authorDave Mitchell <davem@fdisolutions.com>
Fri, 30 Dec 2005 12:21:05 +0000 (12:21 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Fri, 30 Dec 2005 12:21:05 +0000 (12:21 +0000)
p4raw-id: //depot/perl@26535

perl.c
sv.c

diff --git a/perl.c b/perl.c
index 469593b..b91373a 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -159,6 +159,9 @@ S_init_tls_and_interp(PerlInterpreter *my_perl)
        OP_REFCNT_INIT;
        MUTEX_INIT(&PL_dollarzero_mutex);
 #  endif
        OP_REFCNT_INIT;
        MUTEX_INIT(&PL_dollarzero_mutex);
 #  endif
+#ifdef PERL_IMPLICIT_CONTEXT
+       MUTEX_INIT(&PL_my_ctx_mutex);
+#  endif
     }
     else {
        PERL_SET_THX(my_perl);
     }
     else {
        PERL_SET_THX(my_perl);
diff --git a/sv.c b/sv.c
index 4c615e4..f377c59 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10483,7 +10483,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
        PL_exitlist     = (PerlExitListEntry*)NULL;
 
     PL_my_cxt_size = proto_perl->Imy_cxt_size;
        PL_exitlist     = (PerlExitListEntry*)NULL;
 
     PL_my_cxt_size = proto_perl->Imy_cxt_size;
-    if (PL_my_cxt_size) {
+    if (PL_my_cxt_size != -1) {
        Newx(PL_my_cxt_list, PL_my_cxt_size, void *);
        Copy(proto_perl->Imy_cxt_list, PL_my_cxt_list, PL_my_cxt_size, void *);
     }
        Newx(PL_my_cxt_list, PL_my_cxt_size, void *);
        Copy(proto_perl->Imy_cxt_list, PL_my_cxt_list, PL_my_cxt_size, void *);
     }