This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix failure of C<&locked_sub;> under -Dusethreads
[perl5.git] / t / lib / thread.t
index 8d38523..61997cf 100755 (executable)
@@ -13,7 +13,7 @@ BEGIN {
     $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3;
 }
 $| = 1;
-print "1..14\n";
+print "1..18\n";
 use Thread;
 print "ok 1\n";
 
@@ -71,3 +71,17 @@ sub islocked
 $t = Thread->new(\&islocked, "ok 13\n", "ok 14\n");
 $t->join->join;
 
+{
+    package Loch::Ness;
+    sub new { bless [], shift }
+    sub monster {
+       use attrs qw(locked method);
+       my($s, $m) = @_;
+       print "ok $m\n";
+    }
+    sub gollum { &monster }
+}
+Loch::Ness->monster(15);
+Loch::Ness->new->monster(16);
+Loch::Ness->gollum(17);
+Loch::Ness->new->gollum(18);