diff options
author | Steve Hay <SteveHay@planit.com> | 2004-11-16 09:42:50 +0000 |
---|---|---|
committer | Steve Hay <SteveHay@planit.com> | 2004-11-16 09:42:50 +0000 |
commit | 4026c95ac795414220d662f764bd6e993724505d (patch) | |
tree | 04a79e3b2ce2e22e973f154adbbdeae3c3b9d03e /op.c | |
parent | 68ccb645d74feb45c64863c3223051537fbc9fed (diff) | |
download | perl-4026c95ac795414220d662f764bd6e993724505d.tar.gz |
Fix Win32 breakage caused by changes to op.c in change 23433.
Also limit the scope of the locks in a couple of places, as suggested
by Hugo in http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2004-11/msg00286.html.
p4raw-id: //depot/perl@23499
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -271,6 +271,7 @@ Perl_op_free(pTHX_ OP *o) { register OP *kid, *nextkid; OPCODE type; + PADOFFSET refcnt; if (!o || o->op_static) return; @@ -284,11 +285,10 @@ Perl_op_free(pTHX_ OP *o) case OP_SCOPE: case OP_LEAVEWRITE: OP_REFCNT_LOCK; - if (OpREFCNT_dec(o)) { - OP_REFCNT_UNLOCK; - return; - } + refcnt = OpREFCNT_dec(o); OP_REFCNT_UNLOCK; + if (refcnt) + return; break; default: break; @@ -474,6 +474,18 @@ Perl_op_null(pTHX_ OP *o) o->op_ppaddr = PL_ppaddr[OP_NULL]; } +void +Perl_op_refcnt_lock(pTHX) +{ + OP_REFCNT_LOCK; +} + +void +Perl_op_refcnt_unlock(pTHX) +{ + OP_REFCNT_UNLOCK; +} + /* Contextualizers */ #define LINKLIST(o) ((o)->op_next ? (o)->op_next : linklist((OP*)o)) |