projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2ebeae4
)
rrdtool plugin: Wait for the ``queue thread'' to exit _after_ signaling it to exit..
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Fri, 12 Oct 2007 20:59:15 +0000
(22:59 +0200)
committer
Florian Forster
<octo@huhu.verplant.org>
Tue, 30 Oct 2007 07:24:28 +0000
(08:24 +0100)
src/rrdtool.c
patch
|
blob
|
history
diff --git
a/src/rrdtool.c
b/src/rrdtool.c
index
3688581
..
d274ba0
100644
(file)
--- a/
src/rrdtool.c
+++ b/
src/rrdtool.c
@@
-1053,6
+1053,11
@@
static int rrd_shutdown (void)
rrd_cache_flush (-1);
pthread_mutex_unlock (&cache_lock);
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)
{
/* Wait for all the values to be written to disk before returning. */
if (queue_thread != 0)
{
@@
-1061,11
+1066,6
@@
static int rrd_shutdown (void)
DEBUG ("rrdtool plugin: queue_thread exited.");
}
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 */
return (0);
} /* int rrd_shutdown */