---
title: os_unfair_lock_assert_not_owner
framework: os
role: symbol
role_heading: Function
path: os/os_unfair_lock_assert_not_owner
---

# os_unfair_lock_assert_not_owner

Triggers an assertion if the calling thread owns the specified unfair lock.

## Declaration

```occ
extern void os_unfair_lock_assert_not_owner(const os_unfair_lock *lock);
```

## Parameters

- `lock`: A pointer to the unfair lock to check.

## Discussion

Discussion If the lock is unlocked or owned by a thread other than the calling thread, this function returns normally. If the lock is currently owned by the calling thread, this function asserts and terminates the process.

## See Also

### Unfair Locking

- [os_unfair_lock](os/os_unfair_lock.md)
- [OS_UNFAIR_LOCK_INIT](os/os_unfair_lock_init.md)
- [os_unfair_lock_t](os/os_unfair_lock_t.md)
- [os_unfair_lock_lock](os/os_unfair_lock_lock.md)
- [os_unfair_lock_trylock](os/os_unfair_lock_trylock.md)
- [os_unfair_lock_lock_with_flags](os/os_unfair_lock_lock_with_flags.md)
- [os_unfair_lock_unlock](os/os_unfair_lock_unlock.md)
- [os_unfair_lock_assert_owner](os/os_unfair_lock_assert_owner.md)
- [os_unfair_lock_flags_t](os/os_unfair_lock_flags_t.md)
