]> arthur.barton.de Git - netdata.git/blobdiff - src/avl.h
cleanup locking; ability to compile AVL with MUTEX instead of RWLOCK; disks and inter...
[netdata.git] / src / avl.h
index 8071a87d6ddd456ac4a974359b82bd4d99255ebd..888eed19298a4f489c79477bc1730ec6310285f3 100755 (executable)
--- a/src/avl.h
+++ b/src/avl.h
@@ -17,6 +17,8 @@
 #ifndef _AVL_H
 #define _AVL_H 1
 
+// #define AVL_LOCK_WITH_MUTEX 1
+
 /* Data structures */
 
 /* One element of the AVL tree */
@@ -30,7 +32,12 @@ typedef struct avl {
 typedef struct avl_tree {
        avl* root;
        int (*compar)(void* a, void* b);
+
+#ifdef AVL_LOCK_WITH_MUTEX
+       pthread_mutex_t mutex;
+#else
        pthread_rwlock_t rwlock;
+#endif
 } avl_tree;
 
 /* Public methods */