]> arthur.barton.de Git - netdata.git/blobdiff - src/plugin_tc.c
finalized dictionary.c
[netdata.git] / src / plugin_tc.c
index 2c7a55ceea910c4c50e249baba5a9ff09a3d2753..d70f52650b5601b5c52891b6c29df881eee6ab60 100644 (file)
@@ -94,11 +94,13 @@ static int tc_device_compare(void* a, void* b) {
 avl_tree tc_device_root_index = {
                NULL,
                tc_device_compare,
+#ifndef AVL_WITHOUT_PTHREADS
 #ifdef AVL_LOCK_WITH_MUTEX
                PTHREAD_MUTEX_INITIALIZER
 #else
                PTHREAD_RWLOCK_INITIALIZER
 #endif
+#endif
 };
 
 #define tc_device_index_add(st) avl_insert(&tc_device_root_index, (avl *)(st))
@@ -349,10 +351,12 @@ static struct tc_device *tc_device_create(char *id)
                d->classes_index.compar = tc_class_compare;
 
                int lock;
+#ifndef AVL_WITHOUT_PTHREADS
 #ifdef AVL_LOCK_WITH_MUTEX
                lock = pthread_mutex_init(&d->classes_index.mutex, NULL);
 #else
                lock = pthread_rwlock_init(&d->classes_index.rwlock, NULL);
+#endif
 #endif
                if(lock != 0)
                        fatal("Failed to initialize plugin_tc mutex/rwlock, return code %d.", lock);