From: Vsevolod Stakhov Date: Wed, 17 Jun 2009 14:26:45 +0000 (+0400) Subject: * Try to fix locking problem with double unlocking X-Git-Tag: 0.2.7~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=453ecf68e3b51941944dbc3b1dece11342be3810;p=thirdparty%2Frspamd.git * Try to fix locking problem with double unlocking --- diff --git a/src/mem_pool.c b/src/mem_pool.c index 4261e9f8d5..e034ea6522 100644 --- a/src/mem_pool.c +++ b/src/mem_pool.c @@ -508,7 +508,7 @@ void memory_pool_unlock_mutex (memory_pool_mutex_t *mutex) { mutex->owner = 0; - (void)g_atomic_int_dec_and_test (&mutex->lock); + (void)g_atomic_int_compare_and_exchange (&mutex->lock, 1, 0); } memory_pool_rwlock_t*