@@ -27,11 +27,11 @@ size_t count; }; static struct objc_hashtable *hashtable; #ifdef OF_HAVE_THREADS -static of_spinlock_t spinlock; +static OFSpinlock spinlock; #endif static uint32_t hash(const void *object) { @@ -47,11 +47,11 @@ OF_CONSTRUCTOR() { hashtable = objc_hashtable_new(hash, equal, 2); #ifdef OF_HAVE_THREADS - if (of_spinlock_new(&spinlock) != 0) + if (OFSpinlockNew(&spinlock) != 0) OBJC_ERROR("Failed to create spinlock!"); #endif } id @@ -118,11 +118,11 @@ objc_storeWeak(id *object, id value) { struct weak_ref *old; #ifdef OF_HAVE_THREADS - if (of_spinlock_lock(&spinlock) != 0) + if (OFSpinlockLock(&spinlock) != 0) OBJC_ERROR("Failed to lock spinlock!"); #endif if (*object != nil && (old = objc_hashtable_get(hashtable, *object)) != NULL) { @@ -175,11 +175,11 @@ value = nil; *object = value; #ifdef OF_HAVE_THREADS - if (of_spinlock_unlock(&spinlock) != 0) + if (OFSpinlockUnlock(&spinlock) != 0) OBJC_ERROR("Failed to unlock spinlock!"); #endif return value; } @@ -189,20 +189,20 @@ { id value = nil; struct weak_ref *ref; #ifdef OF_HAVE_THREADS - if (of_spinlock_lock(&spinlock) != 0) + if (OFSpinlockLock(&spinlock) != 0) OBJC_ERROR("Failed to lock spinlock!"); #endif if (*object != nil && (ref = objc_hashtable_get(hashtable, *object)) != NULL) value = *object; #ifdef OF_HAVE_THREADS - if (of_spinlock_unlock(&spinlock) != 0) + if (OFSpinlockUnlock(&spinlock) != 0) OBJC_ERROR("Failed to unlock spinlock!"); #endif if (class_respondsToSelector(object_getClass(value), @selector(retainWeakReference)) && [value retainWeakReference]) @@ -240,11 +240,11 @@ objc_moveWeak(id *dest, id *src) { struct weak_ref *ref; #ifdef OF_HAVE_THREADS - if (of_spinlock_lock(&spinlock) != 0) + if (OFSpinlockLock(&spinlock) != 0) OBJC_ERROR("Failed to lock spinlock!"); #endif if (*src != nil && (ref = objc_hashtable_get(hashtable, *src)) != NULL) { @@ -258,11 +258,11 @@ *dest = *src; *src = nil; #ifdef OF_HAVE_THREADS - if (of_spinlock_unlock(&spinlock) != 0) + if (OFSpinlockUnlock(&spinlock) != 0) OBJC_ERROR("Failed to unlock spinlock!"); #endif } void @@ -269,11 +269,11 @@ objc_zero_weak_references(id value) { struct weak_ref *ref; #ifdef OF_HAVE_THREADS - if (of_spinlock_lock(&spinlock) != 0) + if (OFSpinlockLock(&spinlock) != 0) OBJC_ERROR("Failed to lock spinlock!"); #endif if ((ref = objc_hashtable_get(hashtable, value)) != NULL) { for (size_t i = 0; i < ref->count; i++) @@ -283,9 +283,9 @@ free(ref->locations); free(ref); } #ifdef OF_HAVE_THREADS - if (of_spinlock_unlock(&spinlock) != 0) + if (OFSpinlockUnlock(&spinlock) != 0) OBJC_ERROR("Failed to unlock spinlock!"); #endif }