26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
static OFSpinlock spinlocks[numSpinlocks];
static OF_INLINE size_t
spinlockSlot(const void *ptr)
{
return ((size_t)((uintptr_t)ptr >> 4) & (numSpinlocks - 1));
}
#endif
#ifdef OF_HAVE_THREADS
OF_CONSTRUCTOR()
{
for (size_t i = 0; i < numSpinlocks; i++)
if (OFSpinlockNew(&spinlocks[i]) != 0)
OBJC_ERROR("Failed to create spinlocks!");
}
#endif
|
<
<
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
static OFSpinlock spinlocks[numSpinlocks];
static OF_INLINE size_t
spinlockSlot(const void *ptr)
{
return ((size_t)((uintptr_t)ptr >> 4) & (numSpinlocks - 1));
}
OF_CONSTRUCTOR()
{
for (size_t i = 0; i < numSpinlocks; i++)
if (OFSpinlockNew(&spinlocks[i]) != 0)
OBJC_ERROR("Failed to create spinlocks!");
}
#endif
|