… | |
… | |
2 | |
2 | |
3 | Coro::Semaphore - counting semaphores |
3 | Coro::Semaphore - counting semaphores |
4 | |
4 | |
5 | =head1 SYNOPSIS |
5 | =head1 SYNOPSIS |
6 | |
6 | |
7 | use Coro::Semaphore; |
7 | use Coro; |
8 | |
8 | |
9 | $sig = new Coro::Semaphore [initial value]; |
9 | $sig = new Coro::Semaphore [initial value]; |
10 | |
10 | |
11 | $sig->down; # wait for signal |
11 | $sig->down; # wait for signal |
12 | |
12 | |
… | |
… | |
38 | |
38 | |
39 | use common::sense; |
39 | use common::sense; |
40 | |
40 | |
41 | use Coro (); |
41 | use Coro (); |
42 | |
42 | |
43 | our $VERSION = 5.25; |
43 | our $VERSION = 5.37; |
44 | |
44 | |
45 | =item new [inital count] |
45 | =item new [inital count] |
46 | |
46 | |
47 | Creates a new sempahore object with the given initial lock count. The |
47 | Creates a new sempahore object with the given initial lock count. The |
48 | default lock count is 1, which means it is unlocked by default. Zero (or |
48 | default lock count is 1, which means it is unlocked by default. Zero (or |