1# zx_futex_wake 2 3## NAME 4 5<!-- Updated by update-docs-from-abigen, do not edit. --> 6 7futex_wake - Wake some number of threads waiting on a futex, optionally transferring ownership to the thread which was woken in the process. 8 9## SYNOPSIS 10 11<!-- Updated by update-docs-from-abigen, do not edit. --> 12 13``` 14#include <zircon/syscalls.h> 15 16zx_status_t zx_futex_wake(const zx_futex_t* value_ptr, uint32_t wake_count); 17``` 18 19## DESCRIPTION 20 21Waking a futex causes *wake_count* threads waiting on the *value_ptr* 22futex to be woken up. 23 24Waking up zero threads is not an error condition. Passing in an unallocated 25address for *value_ptr* is not an error condition. 26 27## OWNERSHIP 28 29A successful call to `zx_futex_wake()` results in the owner of the futex being 30set to nothing, regardless of the wake count. In order to transfer ownership of 31a futex, use the [`zx_futex_wake_single_owner()`] variant instead. 32[`zx_futex_wake_single_owner()`] will attempt to wake exactly one thread from the 33futex wait queue. If there is at least one thread to wake, the owner of the 34futex will be set to the thread which was woken. Otherwise, the futex will have 35no owner. 36 37See *Ownership and Priority Inheritance* in [futex](../objects/futex.md) for 38details. 39 40## RIGHTS 41 42<!-- Updated by update-docs-from-abigen, do not edit. --> 43 44None. 45 46## RETURN VALUE 47 48`zx_futex_wake()` returns **ZX_OK** on success. 49 50## ERRORS 51 52**ZX_ERR_INVALID_ARGS** *value_ptr* is not aligned. 53 54## SEE ALSO 55 56 - [futex objects](../objects/futex.md) 57 - [`zx_futex_requeue()`] 58 - [`zx_futex_wait()`] 59 - [`zx_futex_wake_single_owner()`] 60 61<!-- References updated by update-docs-from-abigen, do not edit. --> 62 63[`zx_futex_requeue()`]: futex_requeue.md 64[`zx_futex_wait()`]: futex_wait.md 65[`zx_futex_wake_single_owner()`]: futex_wake_single_owner.md 66