Skip Navigation
Function

os_unfair_lock_lock

A low-level lock that allows waiters to block efficiently on contention.
extern void os_unfair_lock_lock(os_unfair_lock_t lock);

Parameters

lock

A pointer to the unfair lock to be locked.

Discussion

Consider a lock’s data to be opaque and implementation-defined. Locks contain thread-ownership information that the system may use to attempt to resolve priority inversions.

A lock must be unlocked only from the same thread in which it was locked. Attempting to unlock from a different thread causes a runtime error.

A lock must not be accessed from multiple processes or threads via shared or multiply-mapped memory, because the lock implementation relies on the address of the lock value and owning process.

See Also

Current page is os_unfair_lock_lock