ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/Semaphore.pm
(Generate patch)

Comparing Coro/Coro/Semaphore.pm (file contents):
Revision 1.151 by root, Sun Jun 26 21:46:03 2016 UTC vs.
Revision 1.152 by root, Fri Jul 14 03:02:45 2017 UTC

15 $sig->up; 15 $sig->up;
16 16
17=head1 DESCRIPTION 17=head1 DESCRIPTION
18 18
19This module implements counting semaphores. You can initialize a mutex 19This module implements counting semaphores. You can initialize a mutex
20with any level of parallel users, that is, you can intialize a sempahore 20with any level of parallel users, that is, you can initialize a sempahore
21that can be C<down>ed more than once until it blocks. There is no owner 21that can be C<down>ed more than once until it blocks. There is no owner
22associated with semaphores, so one thread can C<down> it while another can 22associated with semaphores, so one thread can C<down> it while another can
23C<up> it (or vice versa), C<up> can be called before C<down> and so on: 23C<up> it (or vice versa), C<up> can be called before C<down> and so on:
24the semaphore is really just an integer counter that optionally blocks 24the semaphore is really just an integer counter that optionally blocks
25when it is 0. 25when it is 0.
42 42
43use Coro (); 43use Coro ();
44 44
45our $VERSION = 6.511; 45our $VERSION = 6.511;
46 46
47=item new [inital count] 47=item new [initial count]
48 48
49Creates a new sempahore object with the given initial lock count. The 49Creates a new sempahore object with the given initial lock count. The
50default lock count is 1, which means it is unlocked by default. Zero (or 50default lock count is 1, which means it is unlocked by default. Zero (or
51negative values) are also allowed, in which case the semaphore is locked 51negative values) are also allowed, in which case the semaphore is locked
52by default. 52by default.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines