]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Remove useless locking.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 26 May 2015 10:41:17 +0000 (11:41 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 26 May 2015 10:41:17 +0000 (11:41 +0100)
src/libutil/mem_pool.c
src/libutil/mem_pool.h

index 560ac553965bcc78c0765fb33af57eecc334772d..564509739392650482d6289da072f5c8ea7cfa80 100644 (file)
@@ -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);
 }
 
index 7403ced29bec05a1893885af52fd0c40602d52c8..5684f1a49fa60c6b44c01229887b4b760eb1d0e4 100644 (file)
@@ -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;
 
 /**