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

Comparing Coro/Coro/Timer.pm (file contents):
Revision 1.30 by root, Thu Dec 29 14:06:55 2005 UTC vs.
Revision 1.31 by root, Wed Jan 25 21:43:58 2006 UTC

33 33
34BEGIN { 34BEGIN {
35 eval "use Time::HiRes 'time'"; 35 eval "use Time::HiRes 'time'";
36} 36}
37 37
38$VERSION = 1.7; 38$VERSION = 1.8;
39@EXPORT_OK = qw(timeout sleep); 39@EXPORT_OK = qw(timeout sleep);
40 40
41=item $flag = timeout $seconds; 41=item $flag = timeout $seconds;
42 42
43This function will wake up the current coroutine after $seconds 43This function will wake up the current coroutine after $seconds
63 my $current = $Coro::current; 63 my $current = $Coro::current;
64 $timer = _new_timer(time + $_[0], sub { 64 $timer = _new_timer(time + $_[0], sub {
65 undef $timer; # set flag 65 undef $timer; # set flag
66 $current->ready; 66 $current->ready;
67 }); 67 });
68 bless $self, Coro::timeout::; 68 bless $self, 'Coro::timeout'; # weird quoting required by 5.9.3, it seems
69} 69}
70 70
71package Coro::timeout; 71package Coro::timeout;
72 72
73sub bool { 73sub bool {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines