Avoid spurious wakeup on deleted timer event (#11069)
Avoid spurious wakeup on deleted timer event Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
This commit is contained in:
parent
25ffa79b64
commit
7be86177a3
2
src/ae.c
2
src/ae.c
|
@ -263,7 +263,7 @@ static int64_t usUntilEarliestTimer(aeEventLoop *eventLoop) {
|
||||||
|
|
||||||
aeTimeEvent *earliest = NULL;
|
aeTimeEvent *earliest = NULL;
|
||||||
while (te) {
|
while (te) {
|
||||||
if (!earliest || te->when < earliest->when)
|
if ((!earliest || te->when < earliest->when) && te->id != AE_DELETED_EVENT_ID)
|
||||||
earliest = te;
|
earliest = te;
|
||||||
te = te->next;
|
te = te->next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue