From: Artur Bergman Date: Fri, 3 Jan 2003 15:15:14 +0000 (+0000) Subject: Change pp_lock to take a reference instead of a X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a47f09b1f37ad670eb23486a6efdb4c448efdfa;p=p5sagit%2Fp5-mst-13.2.git Change pp_lock to take a reference instead of a scalar since it wouldn't fork for the HELEM/AELEM case. This was reported in bug #10045 p4raw-id: //depot/perl@18413 --- diff --git a/ext/threads/shared/t/hv_refs.t b/ext/threads/shared/t/hv_refs.t index 94bf822..fb3c8de 100644 --- a/ext/threads/shared/t/hv_refs.t +++ b/ext/threads/shared/t/hv_refs.t @@ -30,7 +30,7 @@ sub skip { use ExtUtils::testlib; use strict; -BEGIN { print "1..13\n" }; +BEGIN { print "1..14\n" }; use threads; use threads::shared; ok(1,1,"loaded"); @@ -75,3 +75,16 @@ ok(10, keys %foo == 0, "And make sure we realy have deleted the values"); ok(13, $hash1{hash}->{hash}->{thread} eq "yes", "Check hash created in another thread"); } +{ + my $h = {a=>14}; + my $r = \$h->{a}; + share($r); + lock($r); + lock($h->{a}); + ok(14, 1, "lock on helems now work, this was bug 10045"); + +} + + + + diff --git a/opcode.h b/opcode.h index ff3c48f..b77c0a8 100644 --- a/opcode.h +++ b/opcode.h @@ -1824,7 +1824,7 @@ EXT U32 PL_opargs[] = { 0x00000014, /* egrent */ 0x0000000c, /* getlogin */ 0x0004281d, /* syscall */ - 0x00003604, /* lock */ + 0x0000f604, /* lock */ 0x00000044, /* threadsv */ 0x00001404, /* setstate */ 0x00000c40, /* method_named */ diff --git a/opcode.pl b/opcode.pl index d055f58..4aacb2d 100755 --- a/opcode.pl +++ b/opcode.pl @@ -913,7 +913,7 @@ getlogin getlogin ck_null st0 syscall syscall ck_fun imst@ S L # For multi-threading -lock lock ck_rfun s% S +lock lock ck_rfun s% R threadsv per-thread value ck_null ds0 # Control (contd.)