Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 1.74 KB

futex_wake.md

File metadata and controls

65 lines (41 loc) · 1.74 KB

zx_futex_wake

NAME

futex_wake - Wake some number of threads waiting on a futex, optionally transferring ownership to the thread which was woken in the process.

SYNOPSIS

#include <zircon/syscalls.h>

zx_status_t zx_futex_wake(const zx_futex_t* value_ptr, uint32_t wake_count);

DESCRIPTION

Waking a futex causes wake_count threads waiting on the value_ptr futex to be woken up.

Waking up zero threads is not an error condition. Passing in an unallocated address for value_ptr is not an error condition.

OWNERSHIP

A successful call to zx_futex_wake() results in the owner of the futex being set to nothing, regardless of the wake count. In order to transfer ownership of a futex, use the zx_futex_wake_single_owner() variant instead. zx_futex_wake_single_owner() will attempt to wake exactly one thread from the futex wait queue. If there is at least one thread to wake, the owner of the futex will be set to the thread which was woken. Otherwise, the futex will have no owner.

See Ownership and Priority Inheritance in futex for details.

RIGHTS

None.

RETURN VALUE

zx_futex_wake() returns ZX_OK on success.

ERRORS

ZX_ERR_INVALID_ARGS value_ptr is not aligned.

SEE ALSO