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.
This commit is contained in:
Nick Mathewson 2011-02-02 20:09:16 -05:00
parent e47042fe26
commit 77a96fd901

11
event.c
View File

@ -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. */