From 7aa6c12a4424d00ea0add0a849f8a5b31a2de6a1 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Sat, 28 Aug 2010 20:14:36 +0200 Subject: Clean-up: Remove pthread and mutex locking code This code was not activated at all, and hard coded as disabled in syshead.h with this code snippet: /* * Pthread support is currently experimental (and quite unfinished). */ #if 1 /* JYFIXME -- if defined, disable pthread */ #undef USE_PTHREAD #endif So no matter if --enable-pthread when running ./configure or not, this feature was never enabled in reality. Further, by removing the blocker code above made OpenVPN uncompilable in the current state. As the threading part needs to be completely rewritten and pthreading will not be supported in OpenVPN 2.x, removing this code seems most reasonable. In addition, a lot of mutex locking code was also removed, as they were practically NOP functions, due to pthreading being forcefully disabled Signed-off-by: David Sommerseth Acked-by: James Yonan --- list.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'list.h') diff --git a/list.h b/list.h index 3f4a931..138e894 100644 --- a/list.h +++ b/list.h @@ -40,7 +40,6 @@ /*#define LIST_TEST*/ #include "basic.h" -#include "thread.h" #include "buffer.h" #define hashsize(n) ((uint32_t)1<<(n)) @@ -56,7 +55,6 @@ struct hash_element struct hash_bucket { - MUTEX_DEFINE (mutex); struct hash_element *list; }; @@ -152,13 +150,11 @@ hash_bucket (struct hash *hash, uint32_t hv) static inline void hash_bucket_lock (struct hash_bucket *bucket) { - mutex_lock (&bucket->mutex); } static inline void hash_bucket_unlock (struct hash_bucket *bucket) { - mutex_unlock (&bucket->mutex); } static inline void * @@ -168,11 +164,9 @@ hash_lookup_lock (struct hash *hash, const void *key, uint32_t hv) struct hash_element *he; struct hash_bucket *bucket = &hash->buckets[hv & hash->mask]; - mutex_lock (&bucket->mutex); he = hash_lookup_fast (hash, bucket, key, hv); if (he) ret = he->value; - mutex_unlock (&bucket->mutex); return ret; } @@ -211,9 +205,7 @@ hash_remove (struct hash *hash, const void *key) hv = hash_value (hash, key); bucket = &hash->buckets[hv & hash->mask]; - mutex_lock (&bucket->mutex); ret = hash_remove_fast (hash, bucket, key, hv); - mutex_unlock (&bucket->mutex); return ret; } -- cgit v1.2.3