int found;
assert(eq != NULL);
- assert(msg != NULL);
event_queue_lock(eq);
if(me->jobid) {
- free(me->jobid);
me->jobid = NULL;
me->current = NULL;
}
}
el = el->prev;
} while(el != eq->head);
- if(found) {
+ if(found && msg) {
me->current = el;
- me->jobid = strdup(el->msg->job_id_s);
+ me->jobid = el->msg->job_id_s;
*msg = el->msg;
- } else {
}
event_queue_unlock(eq);
if(eq->cur_len <= queue_size_low) {
eq->throttling = 0;
}
+
+ me->current = NULL;
+ me->jobid = NULL;
event_queue_unlock(eq);
/* end of critical section */
group_c_test_d ()
{
- COMPONENT_ARGS="-p $parallel -i /tmp/perftest_il.pid -d --lazy=10 --nosync --norecover $COMM_ARGS"
+ COMPONENT_ARGS="-p$parallel -i /tmp/perftest_il.pid -d --lazy=10 --nosync --norecover $COMM_ARGS"
echo -n "d)"
run_test il $numjobs
print_result
group_c_test_e ()
{
- COMPONENT_ARGS="-p $parallel -i /tmp/perftest_il.pid -d $COMM_ARGS"
+ COMPONENT_ARGS="-p$parallel -i /tmp/perftest_il.pid -d $COMM_ARGS"
echo -n "e)"
run_test il $numjobs
print_result
/* if there are no events, wait for them */
ret = 0;
- while (event_queue_empty(eq)
+ while ((event_queue_empty(eq) || event_queue_get(eq, me, NULL) == 0)
#if defined(INTERLOGD_HANDLE_CMD) && defined(INTERLOGD_FLUSH)
&& (eq->flushing != 1)
#endif
event_queue_cond_unlock(eq);
pthread_exit((void*)-1);
}
- /* sleep only once when there is no event available for this particular thread */
} /* END while(empty) */
now = time(NULL);
event_queue_move_events(eq, NULL, cmp_expires, &now);
}
- if(!event_queue_empty(eq)) {
-
+ if(!event_queue_empty(eq) && event_queue_get(eq, me, NULL) != 0) {
+
/* deliver pending events */
glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG,
" thread %x: attempting delivery to %s",
event_queue_lock(eq);
if(me->jobid) {
- free(me->jobid);
me->jobid = NULL;
me->current = NULL;
}