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))
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);