summaryrefslogtreecommitdiffstats
path: root/src/avl.h
diff options
context:
space:
mode:
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 */