assert(eq != NULL);
event_queue_lock_ro(eq);
- ret = eq->head == NULL;
+ ret = (eq->head == NULL);
event_queue_unlock(eq);
return(ret);
if(eq->mark_this && (el->prev == eq->mark_this))
eq->mark_prev = el;
#endif
+
event_queue_unlock(eq);
/* end of critical section */
assert(eq != NULL);
assert(msg != NULL);
- event_queue_lock_ro(eq);
+ event_queue_lock(eq);
el = eq->head;
#if defined(INTERLOGD_EMS)
/* this message is marked for removal, it is first on the queue */
}
if(el == eq->tail) {
/* we are removing the last message */
- eq->tail = NULL;
+ eq->tail = prev;
}
if(el == eq->tail_ems) {
/* we are removing last priority message */
- eq->tail_ems = NULL;
+ eq->tail_ems = prev;
}
eq->mark_this = NULL;
eq_s->tail = NULL;
while(p) {
if(strcmp(p->msg->job_id_s, notif_id) == 0) {
- il_log(LOG_DEBUG, " moving event with notif id %s from %s:%d to %s:%d\n",
- notif_id, eq_s->dest_name,eq_s->dest_port, eq_d ? eq_d->dest_name : "trash",eq_d ? eq_d->dest_port : -1);
+ il_log(LOG_DEBUG, " moving event at offset %d from %s:%d to %s:%d\n",
+ p->msg->offset, eq_s->dest_name,eq_s->dest_port, eq_d ? eq_d->dest_name : "trash",eq_d ? eq_d->dest_port : -1);
+ il_log(LOG_DEBUG, " current: %x, next: %x\n", p, p->prev);
/* remove the message from the source list */
*source_prev = p->prev;
if(eq_d) {
queue_thread(void *q)
{
struct event_queue *eq = (struct event_queue *)q;
- int ret, exit, flushing;
+ int ret, exit;
if(init_errors(0) < 0) {
il_log(LOG_ERR, "Error initializing thread specific data, exiting!");
ret = 0;
while (event_queue_empty(eq)
#if defined(INTERLOGD_HANDLE_CMD) && defined(INTERLOGD_FLUSH)
- && ((flushing=eq->flushing) != 1)
+ && (eq->flushing != 1)
#endif
) {
ret = event_queue_wait(eq, 0);
event_queue_cond_lock(eq);
/* Check if we are flushing and if we are, report status to master */
- if(flushing == 1) {
+ if(eq->flushing == 1) {
il_log(LOG_DEBUG, " flushing mode detected, reporting status\n");
/* 0 - events waiting, 1 - events sent, < 0 - some error */
eq->flush_result = ret;