atomic_test_and_set
extern int32 atomic_test_and_set(int32 *value, int32 newValue, int32 testAgainst);
if (atomic_test_and_set(&lock->count, -1, 0) != 0)
return atomic_test_and_set(&lock->lock, 1u << 31, 0) == 0;
if (atomic_test_and_set(&thread->wait.status, status, 1) != 1)
return (PointerType*)atomic_test_and_set((int32*)_pointer, (int32)set,
thread_id previousThread = atomic_test_and_set(&page->accessing_thread,
thread_id previousThread = atomic_test_and_set(&page->accessing_thread, -1,
thread_id previousThread = atomic_test_and_set(&page->accessing_thread,
} while (atomic_test_and_set((int32*)lock, newValue, oldValue) != (int32)oldValue);
} while (atomic_test_and_set((int32*)lock, newValue, oldValue) != (int32)oldValue);
} while (atomic_test_and_set(&sc->ec_sci_pending, 0, pending));
if (atomic_test_and_set(&bus->busy, 1, 0) != 0)
return atomic_test_and_set(v, 1, 0);
atomic_test_and_set(&sMaxAllocatedDataHeaderCount, current, max);
atomic_test_and_set(&sMaxAllocatedNetBufferCount, current, max);
if (atomic_test_and_set(&idlingState.preparing, 0, 1) == 1)
if (atomic_test_and_set(&idlingState.preparing, 0, 1) == 1)
} while (atomic_test_and_set(&fUseCount, count + 1, count) != count);
atomic_test_and_set(&fPointer->fUseCount, 0, 1);
(atomic_test_and_set((int32*)ptr, new, old) == old)
return atomic_test_and_set(&fLock, -1, 0) == 0;
int32 oldValue = atomic_test_and_set((int32*)value, newValue, testAgainst);
return atomic_test_and_set((int32*)entry, newEntry, oldEntry);
page_table_entry oldEntry = atomic_test_and_set((int32*)entry,
return atomic_test_and_set((int32*)entry, newEntry, oldEntry);
return atomic_test_and_set((int32*)entry, newEntry, oldEntry);
return atomic_test_and_set((int32*)entry, newEntry, oldEntry);
while (atomic_test_and_set(&sEarlyBootMessageLock, 1, 0) != 0)
return atomic_test_and_set((int32*)entry, newEntry, oldEntry);
if ((uint32)atomic_test_and_set((int32*)&fReadHead,
if (oldRefCount > 0 && atomic_test_and_set(&vnode->ref_count,
result = atomic_test_and_set(value, newValue, testAgainst);
result = atomic_test_and_set(value, newValue, testAgainst);
const int32 oldState = atomic_test_and_set(&port->state,
const int32 oldState = atomic_test_and_set(&port->state,
if (atomic_test_and_set(&sXsiMessageCount, oldCount + 1, oldCount)
return atomic_test_and_set(&lock->lock, 1u << 31, 0) == 0;
if (atomic_test_and_set(&sUnreservedFreePages,
atomic_test_and_set(int32_t* ptr, int32_t desired, int32_t expected)
int32 value = atomic_test_and_set(control, STATE_INITIALIZING,
value = atomic_test_and_set(control, semaphore, STATE_INITIALIZING);
value = atomic_test_and_set(control, STATE_SPINNING,
oldValue = atomic_test_and_set(&lock->lock, B_USER_MUTEX_LOCKED, 0);
atomic_test_and_set(&sNextMallocThreadID, id, id + 1);
atomic_test_and_set((int32*)&cond->lock, B_USER_MUTEX_LOCKED, 0);
if (atomic_test_and_set(&sKeyTable[key].sequence, nextSequence,
const int32 oldValue = atomic_test_and_set((int32*)&mutex->lock, B_USER_MUTEX_LOCKED, 0);
value = atomic_test_and_set((int32*)&onceControl->state,
int32 value = atomic_test_and_set((int32*)&onceControl->state,
value = atomic_test_and_set((int32*)&onceControl->state,
const int32 oldValue = atomic_test_and_set((int32*)&mutex, B_USER_MUTEX_LOCKED, 0);
while (atomic_test_and_set((int32*)&lock->lock, LOCKED, UNLOCKED)
if (atomic_test_and_set((int32*)&lock->lock, LOCKED, UNLOCKED) == LOCKED)
int32 old = atomic_test_and_set(value, current + amount, current);
return atomic_test_and_set((int32*)value, newValue, testAgainst);