From: Artur Bergman Date: Wed, 1 May 2002 19:15:46 +0000 (+0000) Subject: Now passes old test case. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8fc378b1af7a738f51216909699f057338fee03a;p=p5sagit%2Fp5-mst-13.2.git Now passes old test case. p4raw-id: //depot/perl@16315 --- diff --git a/ext/threads/shared/semaphore.pm b/ext/threads/shared/semaphore.pm index f8aa3e0..06cc78e 100644 --- a/ext/threads/shared/semaphore.pm +++ b/ext/threads/shared/semaphore.pm @@ -74,17 +74,17 @@ sub new { sub down { my $s = shift; - lock($s); + lock($$s); my $inc = @_ ? shift : 1; - cond_wait $s until $$s >= $inc; + cond_wait $$s until $$s >= $inc; $$s -= $inc; } sub up { my $s = shift; - lock($s); + lock($$s); my $inc = @_ ? shift : 1; - ($$s += $inc) > 0 and cond_broadcast $s; + ($$s += $inc) > 0 and cond_broadcast $$s; } 1;