Change 18413 by sky@sky-tibook on 2003/01/03 15:15:14
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
Affected files ...
... //depot/perl/ext/threads/shared/t/hv_refs.t#8 edit
... //depot/perl/opcode.h#83 edit
... //depot/perl/opcode.pl#99 edit
... //depot/perl/opnames.h#13 edit
Differences ...
==== //depot/perl/ext/threads/shared/t/hv_refs.t#8 (text) ====
Index: perl/ext/threads/shared/t/hv_refs.t
--- perl/ext/threads/shared/t/hv_refs.t#7~17810~ Fri Aug 30 04:58:18 2002
+++ perl/ext/threads/shared/t/hv_refs.t Fri Jan 3 07:15:14 2003
@@ -30,7 +30,7 @@
use ExtUtils::testlib;
use strict;
-BEGIN { print "1..13\n" };
+BEGIN { print "1..14\n" };
use threads;
use threads::shared;
ok(1,1,"loaded");
@@ -74,4 +74,17 @@
threads->create(sub { my (%hash3); share(%hash3); $hash2{hash} = \%hash3;
$hash3{"thread"} = "yes"})->join();
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");
+
+}
+
+
+
==== //depot/perl/opcode.h#83 (text+w) ====
Index: perl/opcode.h
--- perl/opcode.h#82~17682~ Mon Aug 5 08:04:54 2002
+++ perl/opcode.h Fri Jan 3 07:15:14 2003
@@ -1824,7 +1824,7 @@
0x00000014, /* egrent */
0x0000000c, /* getlogin */
0x0004281d, /* syscall */
- 0x00003604, /* lock */
+ 0x0000f604, /* lock */
0x00000044, /* threadsv */
0x00001404, /* setstate */
0x00000c40, /* method_named */
==== //depot/perl/opcode.pl#99 (xtext) ====
Index: perl/opcode.pl
--- perl/opcode.pl#98~18160~ Tue Nov 19 04:07:25 2002
+++ perl/opcode.pl Fri Jan 3 07:15:14 2003
@@ -913,7 +913,7 @@
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.)
End of Patch.