OSTryAcquireSpinLockWithTimeout

Syntax

#include <cafe/os.h>

BOOL OSTryAcquireSpinLockWithTimeout(OSSpinLock* spinlock, OSTimeNanoseconds timeout);

Parameters

spinlock Pointer to the OSSpinlock to attempt to acquire.
timeout Minimum number of nanoseconds to wait before returning FALSE.

Adhering to an exact number of nanoseconds is not guaranteed. This function only has a time-inspection granularity roughly equivalent to the processor timebase.

Return Values

Returns TRUE if the OSSpinlock was acquired, or FALSE if the OSSpinLock could not be acquired before the timeout.

Description

Attempts to acquire an OSSpinLock until the timeout time is reached. A thread may acquire the spinlock recursively.

Do Not Call From

Callbacks Do not call this function from any callback function.

See Also

OSInitSpinLock
OSAcquireSpinLock
OSReleaseSpinLock
OSTryAcquireSpinLock

Revision History

2013/05/08 Automated cleanup pass.
2012/08/01 Cleanup Pass.
2010/08/23 Initial version.


CONFIDENTIAL