projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fbaf81a
)
src/daemon/utils_cache.c: Read time *after* acquiring the lock.
author
Florian Forster
<octo@collectd.org>
Thu, 18 May 2017 07:23:32 +0000
(09:23 +0200)
committer
Florian Forster
<octo@collectd.org>
Thu, 18 May 2017 07:23:32 +0000
(09:23 +0200)
Fixes: #1193
src/daemon/utils_cache.c
patch
|
blob
|
history
diff --git
a/src/daemon/utils_cache.c
b/src/daemon/utils_cache.c
index
fe0e083
..
a23aef8
100644
(file)
--- a/
src/daemon/utils_cache.c
+++ b/
src/daemon/utils_cache.c
@@
-222,8
+222,6
@@
int uc_init(void) {
} /* int uc_init */
int uc_check_timeout(void) {
- cdtime_t now = cdtime();
-
struct {
char *key;
cdtime_t time;
@@
-232,6
+230,7
@@
int uc_check_timeout(void) {
size_t expired_num = 0;
pthread_mutex_lock(&cache_lock);
+ cdtime_t now = cdtime();
/* Build a list of entries to be flushed */
c_avl_iterator_t *iter = c_avl_get_iterator(cache_tree);