@@ -8,10 +8,12 @@ * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #include "config.h" + +#include #import #import "OFExceptions.h" @@ -43,16 +45,16 @@ if (atomic) { id *ptr = (id*)((char*)self + offset); #ifdef OF_THREADS unsigned hash = SPINLOCK_HASH(ptr); - of_spinlock_lock(&spinlocks[hash]); + assert(of_spinlock_lock(&spinlocks[hash])); @try { return [[*ptr retain] autorelease]; } @finally { - of_spinlock_unlock(&spinlocks[hash]); + assert(of_spinlock_unlock(&spinlocks[hash])); } #else return [[*ptr retain] autorelease]; #endif } @@ -67,11 +69,11 @@ if (atomic) { id *ptr = (id*)((char*)self + offset); #ifdef OF_THREADS unsigned hash = SPINLOCK_HASH(ptr); - of_spinlock_lock(&spinlocks[hash]); + assert(of_spinlock_lock(&spinlocks[hash])); @try { #endif id old = *ptr; @@ -92,11 +94,11 @@ } [old release]; #ifdef OF_THREADS } @finally { - of_spinlock_unlock(&spinlocks[hash]); + assert(of_spinlock_unlock(&spinlocks[hash])); } #endif return; }