… | |
… | |
54 | method waits until the semaphore is available if the counter is zero. |
54 | method waits until the semaphore is available if the counter is zero. |
55 | |
55 | |
56 | =cut |
56 | =cut |
57 | |
57 | |
58 | sub down { |
58 | sub down { |
59 | Coro::Semaphore::down ($_[0][1]{$_[1]} ||= new undef, $_[0][0]); |
59 | Coro::Semaphore::down ($_[0][1]{$_[1]} ||= Coro::Semaphore::_alloc $_[0][0]); |
60 | } |
60 | } |
61 | |
61 | |
62 | #ub timed_down { |
62 | #ub timed_down { |
63 | # require Coro::Timer; |
63 | # require Coro::Timer; |
64 | # my $timeout = Coro::Timer::timeout ($_[2]); |
64 | # my $timeout = Coro::Timer::timeout ($_[2]); |