]> arthur.barton.de Git - netdata.git/commitdiff
disabled charts where re-enabled; fixes #371
authorCosta Tsaousis <costa@tsaousis.gr>
Thu, 5 May 2016 19:04:19 +0000 (22:04 +0300)
committerCosta Tsaousis <costa@tsaousis.gr>
Thu, 5 May 2016 19:04:19 +0000 (22:04 +0300)
src/rrd.c

index 86ff396877910b98d9afd510a97af922e83b6752..909533dcbe5d911a6925fcdb9d2a61d86fd060e5 100644 (file)
--- a/src/rrd.c
+++ b/src/rrd.c
@@ -53,11 +53,13 @@ static int rrdset_compare(void* a, void* b) {
 avl_tree rrdset_root_index = {
                NULL,
                rrdset_compare,
+#ifndef AVL_WITHOUT_PTHREADS
 #ifdef AVL_LOCK_WITH_MUTEX
                PTHREAD_MUTEX_INITIALIZER
 #else
                PTHREAD_RWLOCK_INITIALIZER
 #endif
+#endif
 };
 
 #define rrdset_index_add(st) avl_insert(&rrdset_root_index, (avl *)(st))
@@ -94,11 +96,13 @@ static int rrdset_compare_name(void* a, void* b) {
 avl_tree rrdset_root_index_name = {
                NULL,
                rrdset_compare_name,
+#ifndef AVL_WITHOUT_PTHREADS
 #ifdef AVL_LOCK_WITH_MUTEX
                PTHREAD_MUTEX_INITIALIZER
 #else
                PTHREAD_RWLOCK_INITIALIZER
 #endif
+#endif
 };
 
 int rrdset_index_add_name(RRDSET *st) {
@@ -846,7 +850,8 @@ unsigned long long rrdset_done(RRDSET *st)
        pthread_rwlock_rdlock(&st->rwlock);
 
        // enable the chart, if it was disabled
-       st->enabled = 1;
+       if(unlikely(rrd_delete_unupdated_dimensions) && !st->enabled)
+               st->enabled = 1;
 
        // check if the chart has a long time to be updated
        if(unlikely(st->usec_since_last_update > st->entries * st->update_every * 1000000ULL)) {