summaryrefslogtreecommitdiff
path: root/src/or/scheduler.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-10-14 13:17:11 -0400
committerAndrea Shepard <andrea@torproject.org>2014-09-30 22:48:26 -0700
commit85ee5b3095f60052412a0bbb1ef0a4ccd5b7c97e (patch)
treed002bd07a13fce8ad1d5d7c96c2220de0e7decf6 /src/or/scheduler.c
parentfc13184e44e4dd99d065ceff3068b09d713e3758 (diff)
downloadtor-85ee5b3095f60052412a0bbb1ef0a4ccd5b7c97e.tar.gz
tor-85ee5b3095f60052412a0bbb1ef0a4ccd5b7c97e.zip
Use event_active, not 0-length timeouts. It's idempotent, too.
Diffstat (limited to 'src/or/scheduler.c')
-rw-r--r--src/or/scheduler.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index d965f3b845..e2dcdb5d32 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -117,7 +117,6 @@ static smartlist_t *channels_pending = NULL;
*/
static struct event *run_sched_ev = NULL;
-static struct timeval run_sched_tv;
/* Scheduler static function declarations */
@@ -300,13 +299,7 @@ static void
scheduler_retrigger(void)
{
tor_assert(run_sched_ev);
-
- if (!evtimer_pending(run_sched_ev, NULL)) {
- log_debug(LD_SCHED, "Retriggering scheduler event");
-
- event_del(run_sched_ev);
- evtimer_add(run_sched_ev, &run_sched_tv);
- }
+ event_active(run_sched_ev, EV_TIMEOUT, 1);
}
/** Notify the scheduler of a channel being closed */
@@ -362,10 +355,7 @@ scheduler_trigger(void)
tor_assert(run_sched_ev);
- run_sched_tv.tv_sec = 0;
- run_sched_tv.tv_usec = 0;
-
- evtimer_add(run_sched_ev, &run_sched_tv);
+ event_add(run_sched_ev, EV_TIMEOUT, 1);
}
#endif