NAME
counter - A semaphore-like object for synchronizing across processes
SYNOPSIS
A counter is like an event, but with an integer that can be incremented, decremented, read, or written.
DESCRIPTION
Counter is a synchronization tool allowing processes to coordinate and synchronize their actions. A counter contains a signed 64-bit integer and is somewhat similar to a counting semaphore.
Counter is designed to be used with zx_object_wait_one()
,
zx_object_wait_many()
, or zx_object_wait_async()
.
SIGNALS
In addition to the standard user signals (ZX_USER_SIGNAL_0 through ZX_USER_SIGNAL_7), counter has two signals that are automatically asserted/deasserted based on the value:
ZX_COUNTER_NON_POSITIVE indicates the value is less than or equal to zero.
ZX_COUNTER_POSITIVE indicates the value is greater than or equal to zero.
SYSCALLS
zx_counter_create()
- create a counterzx_counter_add()
- add to a counterzx_counter_read()
- read a counter's valuezx_counter_write()
- write a counter's value