summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3a5dd38)
raw | patch | inline | side by side (parent: 3a5dd38)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 12 Jul 2009 06:28:18 +0000 (06:28 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 12 Jul 2009 06:28:18 +0000 (06:28 +0000) |
It's possible that a "FORGET" was issued in the mean time. -- kevin
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1871 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1871 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_daemon.c | patch | blob | history |
diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c
index d8f140e7f875b8ef04621cdbf0cacbab5e19da45..17ec97edd37eaae65c5bf322d4878f66663e5d51 100644 (file)
--- a/src/rrd_daemon.c
+++ b/src/rrd_daemon.c
}
journal_write("wrote", file);
- pthread_cond_broadcast(&ci->flushed);
+
+ /* Search again in the tree. It's possible someone issued a "FORGET"
+ * while we were writing the update values. */
+ pthread_mutex_lock(&cache_lock);
+ ci = (cache_item_t *) g_tree_lookup(cache_tree, file);
+ if (ci)
+ pthread_cond_broadcast(&ci->flushed);
+ pthread_mutex_unlock(&cache_lock);
rrd_free_ptrs((void ***) &values, &values_num);
free(file);