From: Vsevolod Stakhov Date: Tue, 26 May 2015 10:41:17 +0000 (+0100) Subject: Remove useless locking. X-Git-Tag: 1.0.0~613^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0cbb494df0edc3a0a4704c7d8488c5f6f978db8d;p=thirdparty%2Frspamd.git Remove useless locking. --- diff --git a/src/libutil/mem_pool.c b/src/libutil/mem_pool.c index 560ac55396..5645097393 100644 --- a/src/libutil/mem_pool.c +++ b/src/libutil/mem_pool.c @@ -33,8 +33,8 @@ #define MUTEX_SLEEP_TIME 10000000L #define MUTEX_SPIN_COUNT 100 -#define POOL_MTX_LOCK() do { rspamd_mutex_lock (pool->mtx); } while (0) -#define POOL_MTX_UNLOCK() do { rspamd_mutex_unlock (pool->mtx); } while (0) +#define POOL_MTX_LOCK() do { } while (0) +#define POOL_MTX_UNLOCK() do { } while (0) /* * This define specify whether we should check all pools for free space for new object @@ -224,7 +224,6 @@ rspamd_mempool_new (gsize size) new->destructors = NULL; /* Set it upon first call of set variable */ new->variables = NULL; - new->mtx = rspamd_mutex_new (); mem_pool_stat->pools_allocated++; @@ -616,7 +615,6 @@ rspamd_mempool_delete (rspamd_mempool_t * pool) g_atomic_int_inc (&mem_pool_stat->pools_freed); POOL_MTX_UNLOCK (); - rspamd_mutex_free (pool->mtx); g_slice_free (rspamd_mempool_t, pool); } diff --git a/src/libutil/mem_pool.h b/src/libutil/mem_pool.h index 7403ced29b..5684f1a49f 100644 --- a/src/libutil/mem_pool.h +++ b/src/libutil/mem_pool.h @@ -93,7 +93,6 @@ typedef struct memory_pool_s { struct _pool_chain_shared *shared_pool; /**< shared chain */ struct _pool_destructors *destructors; /**< destructors chain */ GHashTable *variables; /**< private memory pool variables */ - struct rspamd_mutex_s *mtx; /**< threads lock */ } rspamd_mempool_t; /**