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.82 by root, Wed Nov 19 11:11:10 2008 UTC vs.
Revision 1.89 by root, Mon Mar 16 22:22:12 2009 UTC

1=head1 NAME 1=head1 NAME
2 2
3Coro::Semaphore - non-binary semaphores 3Coro::Semaphore - counting semaphores
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use Coro::Semaphore; 7 use Coro::Semaphore;
8 8
35 35
36no warnings; 36no warnings;
37 37
38use Coro (); 38use Coro ();
39 39
40$VERSION = 5.0; 40$VERSION = 5.131;
41 41
42=item new [inital count] 42=item new [inital count]
43 43
44Creates a new sempahore object with the given initial lock count. The 44Creates a new sempahore object with the given initial lock count. The
45default lock count is 1, which means it is unlocked by default. Zero (or 45default lock count is 1, which means it is unlocked by default. Zero (or
136=cut 136=cut
137 137
138sub guard { 138sub guard {
139 &down; 139 &down;
140 # double indirection because bless works on the referenced 140 # double indirection because bless works on the referenced
141 # object, not (only) on the reference itself. 141 # object, not (just) on the reference itself.
142 bless \\$_[0], Coro::Semaphore::guard::; 142 bless \\$_[0], Coro::Semaphore::guard::;
143} 143}
144 144
145#=item $guard = $sem->timed_guard ($timeout) 145#=item $guard = $sem->timed_guard ($timeout)
146# 146#

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines