diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-14 07:04:54 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-14 07:04:54 +0000 |
commit | 0f5feb8dcd2bdb835f78952aa842c128d6c5b2aa (patch) | |
tree | fec8f9621e8a97e1dbee5117e628678a8a7deeae /t | |
parent | 778ddebdd36200650e05e3789258e36307a5988b (diff) | |
download | perl-0f5feb8dcd2bdb835f78952aa842c128d6c5b2aa.tar.gz |
tweak t/lib/thread.t
p4raw-id: //depot/perl@1487
Diffstat (limited to 't')
-rwxr-xr-x | t/lib/thread.t | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/t/lib/thread.t b/t/lib/thread.t index 6d3fdde6ab..853fa392b9 100755 --- a/t/lib/thread.t +++ b/t/lib/thread.t @@ -10,7 +10,7 @@ BEGIN { } } $| = 1; -print "1..9\n"; +print "1..12\n"; use Thread; print "ok 1\n"; @@ -36,19 +36,20 @@ sub islocked use attrs 'locked'; my $val = shift; my $ret; + print $val; if (@_) { - $ret = new Thread \&islocked,shift; - sleep 2; + $ret = Thread->new(\&islocked, @_); + join $ret; } - print $val; } -$t = islocked("ok 6\n","ok 7\n"); +$t = new Thread \&islocked, map { "ok $_\n" } 6..10; +sleep 2; join $t; # test that sleep lets other thread run -$t = new Thread \&islocked,"ok 8\n"; +$t = new Thread \&islocked,"ok 11\n"; sleep 6; -print "ok 9\n"; +print "ok 12\n"; join $t; |