From 77a96fd90186251f5e2ffeafefbf1e401aefd69a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 2 Feb 2011 20:09:16 -0500 Subject: [PATCH] Remove a needless base-notify when rescheduling the first timeout We don't need to wake up the base when rescheduling the timeout that will expire first: the base will already wake up, see that nothing is ready, and go back to sleep. --- event.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/event.c b/event.c index 63927085..b6a5f078 100644 --- a/event.c +++ b/event.c @@ -2027,17 +2027,6 @@ event_add_internal(struct event *ev, const struct timeval *tv, if (ev->ev_closure == EV_CLOSURE_PERSIST && !tv_is_absolute) ev->ev_io_timeout = *tv; - /* - * we already reserved memory above for the case where we - * are not replacing an existing timeout. - */ - if (ev->ev_flags & EVLIST_TIMEOUT) { - /* XXX I believe this is needless. */ - if (min_heap_elt_is_top(ev)) - notify = 1; - /*event_queue_remove(base, ev, EVLIST_TIMEOUT);*/ - } - /* Check if it is active due to a timeout. Rescheduling * this timeout before the callback can be executed * removes it from the active list. */