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.4 by root, Tue Jul 10 21:19:47 2001 UTC vs.
Revision 1.5 by root, Sat Jul 14 22:14:21 2001 UTC

20 20
21=cut 21=cut
22 22
23package Coro::Semaphore; 23package Coro::Semaphore;
24 24
25use Coro::Process (); 25use Coro ();
26 26
27$VERSION = 0.01; 27$VERSION = 0.01;
28 28
29=item new [inital count, default zero] 29=item new [inital count, default zero]
30 30
45=cut 45=cut
46 46
47sub down { 47sub down {
48 my $self = shift; 48 my $self = shift;
49 while ($self->[0] <= 0) { 49 while ($self->[0] <= 0) {
50 push @{$self->[1]}, $Coro::Process::current; 50 push @{$self->[1]}, $Coro::current;
51 Coro::Process::schedule; 51 Coro::schedule;
52 } 52 }
53 --$self->[0]; 53 --$self->[0];
54} 54}
55 55
56=item $sem->up 56=item $sem->up

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines