mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-19 01:04:58 -04:00
Merge remote-tracking branch 'origin/patches-2.0'
This commit is contained in:
commit
9ce5053d6e
6
event.c
6
event.c
@ -1119,6 +1119,7 @@ event_signal_closure(struct event_base *base, struct event *ev)
|
|||||||
|
|
||||||
/* Allows deletes to work */
|
/* Allows deletes to work */
|
||||||
ncalls = ev->ev_ncalls;
|
ncalls = ev->ev_ncalls;
|
||||||
|
if (ncalls != 0)
|
||||||
ev->ev_pncalls = &ncalls;
|
ev->ev_pncalls = &ncalls;
|
||||||
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
||||||
while (ncalls) {
|
while (ncalls) {
|
||||||
@ -1132,10 +1133,13 @@ event_signal_closure(struct event_base *base, struct event *ev)
|
|||||||
should_break = base->event_break;
|
should_break = base->event_break;
|
||||||
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
||||||
|
|
||||||
if (should_break)
|
if (should_break) {
|
||||||
|
if (ncalls != 0)
|
||||||
|
ev->ev_pncalls = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Common timeouts are special timeouts that are handled as queues rather than
|
/* Common timeouts are special timeouts that are handled as queues rather than
|
||||||
* in the minheap. This is more efficient than the minheap if we happen to
|
* in the minheap. This is more efficient than the minheap if we happen to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user