From 16ce8f600992fe9ef3e6d2c2ed5d6d0c90d6d285 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 5 Dec 2014 10:14:00 -0500 Subject: [PATCH] move log message to correct spot --- mediator.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mediator.c b/mediator.c index 3fe3a3f..dad79e1 100644 --- a/mediator.c +++ b/mediator.c @@ -284,6 +284,10 @@ static void *callid_fetcher(void *p) { while (process_threads_busy); pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); pthread_mutex_unlock(&callid_process_lock); + + pthread_mutex_lock(&mediator_count_lock); + syslog(LOG_DEBUG, "Overall %"PRIu64" CDRs created so far.", mediator_count); + pthread_mutex_unlock(&mediator_count_lock); } medmysql_cleanup(); @@ -322,12 +326,6 @@ static void *callid_worker(void *p) { /* if nothing to do right now, flush SQL queues */ if (!callid_process_queue.length) { pthread_mutex_unlock(&callid_process_lock); - - /* XXX wrong spot for this log? */ - pthread_mutex_lock(&mediator_count_lock); - syslog(LOG_DEBUG, "Overall %"PRIu64" CDRs created so far.", mediator_count); - pthread_mutex_unlock(&mediator_count_lock); - if (medmysql_batch_end(&batches)) abort(); if (medmysql_batch_start(&batches))