summaryrefslogtreecommitdiffstats
path: root/src/avl.h
diff options
context:
space:
mode:
authorLennart Weller <lhw@ring0.de>2016-04-21 12:27:29 +0000
committerLennart Weller <lhw@ring0.de>2016-04-21 12:27:29 +0000
commit30b94862648cdbf4f537337d2e2f01c369a9dee9 (patch)
treef0219dd8bd744fc09899bd0266402e05a4bff854 /src/avl.h
parentImported Upstream version 1.0.0 (diff)
downloadnetdata-30b94862648cdbf4f537337d2e2f01c369a9dee9.tar.xz
netdata-30b94862648cdbf4f537337d2e2f01c369a9dee9.zip
Imported Upstream version 1.1.0upstream/1.1.0
Diffstat (limited to 'src/avl.h')
-rw-r--r--[-rwxr-xr-x]src/avl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/avl.h b/src/avl.h
index cbcc4121..2d1fbc53 100755..100644
--- a/src/avl.h
+++ b/src/avl.h
@@ -15,7 +15,9 @@
#ifndef _AVL_H
#define _AVL_H 1
+#ifndef AVL_WITHOUT_PTHREADS
#include <pthread.h>
+#endif /* AVL_WITHOUT_PTHREADS */
// #define AVL_LOCK_WITH_MUTEX 1
@@ -33,11 +35,13 @@ typedef struct avl_tree {
avl* root;
int (*compar)(void* a, void* b);
+#ifndef AVL_WITHOUT_PTHREADS
#ifdef AVL_LOCK_WITH_MUTEX
pthread_mutex_t mutex;
-#else
+#else /* AVL_LOCK_WITH_MUTEX */
pthread_rwlock_t rwlock;
-#endif
+#endif /* AVL_LOCK_WITH_MUTEX */
+#endif /* AVL_WITHOUT_PTHREADS */
} avl_tree;
/* Public methods */