X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_daemon.c;h=f746a35c876680920dc7329aca82b26163c68ebf;hb=b70616e87e2c23d7ba1286336671946a8eeb9ccb;hp=18b7143765935969a2467746ea473ab22a753a1d;hpb=25ae42fedeab79db1ed39f5f2d9d0fdae5172ce5;p=rrdtool.git diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 18b7143..f746a35 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -428,6 +428,7 @@ static int enqueue_cache_item (cache_item_t *ci, /* {{{ */ if (did_insert) { + pthread_cond_broadcast(&cache_cond); pthread_mutex_lock (&stats_lock); stats_queue_length++; pthread_mutex_unlock (&stats_lock); @@ -500,7 +501,7 @@ static int flush_old_values (int max_age) if (max_age > 0) cfd.abs_timeout = cfd.now - max_age; else - cfd.abs_timeout = cfd.now + 1; + cfd.abs_timeout = cfd.now + 2*config_write_jitter + 1; /* `tree_callback_flush' will return the keys of all values that haven't * been touched in the last `config_flush_interval' seconds in `cfd'. @@ -750,7 +751,6 @@ static int flush_file (const char *filename) /* {{{ */ /* Enqueue at head */ enqueue_cache_item (ci, HEAD); - pthread_cond_signal (&cache_cond); pthread_cond_wait(&ci->flushed, &cache_lock); pthread_mutex_unlock(&cache_lock); @@ -1135,7 +1135,6 @@ static int handle_request_update (int fd, /* {{{ */ && (ci->values_num > 0)) { enqueue_cache_item (ci, TAIL); - pthread_cond_signal (&cache_cond); } pthread_mutex_unlock (&cache_lock);