… | |
… | |
143 | Same as Coro::Semaphore::wait on the specified semaphore. |
143 | Same as Coro::Semaphore::wait on the specified semaphore. |
144 | |
144 | |
145 | =cut |
145 | =cut |
146 | |
146 | |
147 | sub wait { |
147 | sub wait { |
148 | Coro::Semaphore::wait ($_[0][1]{$_[1]} || return $_[0][0] > 0); |
148 | Coro::Semaphore::wait ($_[0][1]{$_[1]} || return); |
149 | } |
149 | } |
150 | |
150 | |
151 | =item $guard = $semset->guard ($id) |
151 | =item $guard = $semset->guard ($id) |
152 | |
152 | |
153 | This method calls C<down> and then creates a guard object. When the guard |
153 | This method calls C<down> and then creates a guard object. When the guard |