]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
* Try to fix locking problem with double unlocking
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 17 Jun 2009 14:26:45 +0000 (18:26 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 17 Jun 2009 14:26:45 +0000 (18:26 +0400)
src/mem_pool.c

index 4261e9f8d534a48e540f524d69de7706b1ad34a1..e034ea65227fedab51cd9f5c4fbb486d66d51e88 100644 (file)
@@ -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*