From: Jarkko Hietaniemi Date: Sun, 28 Apr 2002 17:35:12 +0000 (+0000) Subject: Retract the cond.t part of #16249 since the nature X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b5135157c621a585113d0c5008db555122aa49b3;p=p5sagit%2Fp5-mst-13.2.git Retract the cond.t part of #16249 since the nature of the test changed. p4raw-id: //depot/perl@16250 --- diff --git a/ext/threads/shared/t/cond.t b/ext/threads/shared/t/cond.t index 083af42..c143c02 100644 --- a/ext/threads/shared/t/cond.t +++ b/ext/threads/shared/t/cond.t @@ -1,16 +1,16 @@ BEGIN { chdir 't' if -d 't'; - @INC = qw(../lib .); + push @INC ,'../lib'; require Config; import Config; unless ($Config{'useithreads'}) { print "1..0 # Skip: no threads\n"; exit 0; } - require "test.pl"; } -print "1..4\n"; +print "1..5\n"; use strict; + use threads; use threads::shared; @@ -18,30 +18,23 @@ use threads::shared; my $lock : shared; sub foo { - my $ret = 0; lock($lock); - $ret += 1; + print "ok 1\n"; + sleep 2; + print "ok 2\n"; cond_wait($lock); - $ret += 2; - return $ret; + print "ok 5\n"; } sub bar { - my $ret = 0; lock($lock); - $ret += 1; + print "ok 3\n"; cond_signal($lock); - $ret += 2; - return $ret; + print "ok 4\n"; } -my $tr1 = threads->create(\&foo); +my $tr = threads->create(\&foo); my $tr2 = threads->create(\&bar); -my $rt1 = $tr1->join(); -my $rt2 = $tr2->join(); -ok($rt1 & 1); -ok($rt1 & 2); -ok($rt2 & 1); -ok($rt2 & 2); - +$tr->join(); +$tr2->join();