summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2003-01-03 15:15:14 +0000
committerArtur Bergman <sky@nanisky.com>2003-01-03 15:15:14 +0000
commit5a47f09b1f37ad670eb23486a6efdb4c448efdfa (patch)
tree18b6811e7419b7d7d811cfe4d3cd10c043562cb5
parentea0630ea3fba86265d2781f9d1d36d7250879de1 (diff)
downloadperl-5a47f09b1f37ad670eb23486a6efdb4c448efdfa.tar.gz
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
-rw-r--r--ext/threads/shared/t/hv_refs.t15
-rw-r--r--opcode.h2
-rwxr-xr-xopcode.pl2
3 files changed, 16 insertions, 3 deletions
diff --git a/ext/threads/shared/t/hv_refs.t b/ext/threads/shared/t/hv_refs.t
index 94bf822f8f..fb3c8de3f8 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 ff3c48ff53..b77c0a831c 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 d055f585a2..4aacb2d59a 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.)