X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FDS.pm;h=cea25d90e37516c354e94410148f8299fa64cb15;hb=eb9c415ba4421cecb5157967c843dc7f8720e916;hp=fe794512d50efae39c6c08e623eeb56519a85fb8;hpb=7669985165b5dacb60902406f2b5a894506bdc45;p=public-inbox.git diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index fe794512..cea25d90 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -106,16 +106,13 @@ sub SetLoopTimeout { Add a timer to occur $seconds from now. $seconds may be fractional, but timers are not guaranteed to fire at the exact time you ask for. -Returns a timer object which you can call C<< $timer->cancel >> on if you need -to. - =cut sub add_timer ($$) { my ($secs, $coderef) = @_; my $fire_time = now() + $secs; - my $timer = bless [$fire_time, $coderef], "PublicInbox::DS::Timer"; + my $timer = [$fire_time, $coderef]; if (!@Timers || $fire_time >= $Timers[-1][0]) { push @Timers, $timer; @@ -255,6 +252,8 @@ sub reap_pids { # reentrant SIGCHLD handler (since reap_pids is not reentrant) sub enqueue_reap ($) { push @$nextq, \&reap_pids }; +sub in_loop () { $in_loop } + sub EpollEventLoop { local $in_loop = 1; do { @@ -691,12 +690,6 @@ sub not_idle_long { $exp_at > $now; } -package PublicInbox::DS::Timer; -# [$abs_float_firetime, $coderef]; -sub cancel { - $_[0][1] = undef; -} - 1; =head1 AUTHORS (Danga::Socket)