diff --git a/src/rrdtool.c b/src/rrdtool.c
index 368858172a92dfee9fb52d56eebb3e86e5c2ab57..e356bf19d6d91fb4a275fffb840df0c6f3827a4b 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
/* Write the values to the RRD-file */
srrd_update (queue_entry->filename, NULL, values_num, values);
+ DEBUG ("rrdtool plugin: queue thread: Wrote %i values to %s",
+ values_num, queue_entry->filename);
for (i = 0; i < values_num; i++)
{
rrd_cache_flush (-1);
pthread_mutex_unlock (&cache_lock);
+ pthread_mutex_lock (&queue_lock);
+ do_shutdown = 1;
+ pthread_cond_signal (&queue_cond);
+ pthread_mutex_unlock (&queue_lock);
+
/* Wait for all the values to be written to disk before returning. */
if (queue_thread != 0)
{
DEBUG ("rrdtool plugin: queue_thread exited.");
}
- pthread_mutex_lock (&queue_lock);
- do_shutdown = 1;
- pthread_cond_signal (&queue_cond);
- pthread_mutex_unlock (&queue_lock);
-
return (0);
} /* int rrd_shutdown */