assert(eq != NULL);
event_queue_lock_ro(eq);
- ret = eq->head == NULL;
+ assert((eq->head != NULL) || (eq->tail == NULL));
+ ret = (eq->head == NULL);
event_queue_unlock(eq);
return(ret);
assert(eq != NULL);
assert(msg != NULL);
- event_queue_lock_ro(eq);
+ event_queue_lock(eq);
+ assert((eq->head != NULL) || (eq->tail == NULL));
el = eq->head;
#if defined(INTERLOGD_EMS)
/* this message is marked for removal, it is first on the queue */
/* this is critical section */
event_queue_lock(eq);
+ assert((eq->head != NULL) || (eq->tail == NULL));
#if defined(INTERLOGD_EMS)
el = eq->mark_this;
prev = eq->mark_prev;
/* removing from middle of the queue */
prev->prev = el->prev;
}
- if(el == eq->tail) {
+ if(eq->head == NULL) {
/* we are removing the last message */
eq->tail = NULL;
}
eq->tail = NULL;
}
#endif
+ assert((eq->head != NULL) || (eq->tail == NULL));
event_queue_unlock(eq);
/* end of critical section */