fixed missing loop termination in db_cancel_event() when the event

queue is completely full
This commit is contained in:
Jeff Hill
2003-01-28 17:56:15 +00:00
parent f690464dc0
commit f3ee15a96b

View File

@@ -444,13 +444,16 @@ int db_cancel_event(struct event_block *pevent)
* would be possible.
*/
for ( getix = pevent->ev_que->getix;
pevent->ev_que->evque[getix] != EVENTQEMPTY;
getix = RNGINC ( getix ) ) {
pevent->ev_que->evque[getix] != EVENTQEMPTY; ) {
if ( pevent->ev_que->evque[getix] == pevent ) {
assert ( pevent->ev_que->nCanceled < USHRT_MAX );
pevent->ev_que->nCanceled++;
event_remove ( pevent->ev_que, getix, &canceledEvent );
}
getix = RNGINC ( getix );
if ( getix == pevent->ev_que->getix ) {
break;
}
}
assert ( pevent->npend == 0u );