mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
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:
parent
e47042fe26
commit
77a96fd901
11
event.c
11
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)
|
if (ev->ev_closure == EV_CLOSURE_PERSIST && !tv_is_absolute)
|
||||||
ev->ev_io_timeout = *tv;
|
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
|
/* Check if it is active due to a timeout. Rescheduling
|
||||||
* this timeout before the callback can be executed
|
* this timeout before the callback can be executed
|
||||||
* removes it from the active list. */
|
* removes it from the active list. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user