Locking null mutexes is not recommendable.
Hugo van der Sanden [Sat, 28 Oct 2000 18:41:12 +0000 (19:41 +0100)]
Subject: Re: [ID 20001027.008] Not OK: perl v5.7.0 +DEVEL7462 on i386-freebsd-thread-64all 4.1-stable (UNINSTALLED)
Message-Id: <200010281741.SAA31327@crypt.compulink.co.uk>

p4raw-id: //depot/perl@7473

op.c

diff --git a/op.c b/op.c
index 7d07da8..0ac9060 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4557,6 +4557,11 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
        SvREFCNT_inc(const_sv);
        if (cv) {
            cv_undef(cv);
+#ifdef USE_THREADS
+           New(666, CvMUTEXP(cv), 1, perl_mutex);
+           MUTEX_INIT(CvMUTEXP(cv));
+           CvOWNER(cv) = 0;
+#endif /* USE_THREADS */
            sv_setpv((SV*)cv, "");  /* prototype is "" */
            CvXSUBANY(cv).any_ptr = const_sv;
            CvXSUB(cv) = const_sv_xsub;