|
Nexus Embedded Platform 0.1.0
Statically assembled reusable embedded mechanisms
|
Single-waiter notification port. More...
#include <wait.h>
Data Fields | |
| void * | context |
| uint32_t(* | arm )(void *context) |
| nx_result_t(* | wait )(void *context, uint32_t sequence, uint64_t deadline_us) |
| nx_result_t(* | wake )(void *context) |
Single-waiter notification port.
Caller owns storage and serializes arm/wait. Multiple wake publishers are permitted by each backend's documented context. Sequence is a hint; the predicate/request is authoritative. There must be fewer than 2^32 wakes between arm and recheck. All deadlines are absolute monotonic microseconds in the backend's clock domain, with NX_DEADLINE_NEVER explicitly disabling timeout. Clocks must continue while waiting and never change domain; construct relative budgets with nx_deadline_after to avoid overflow. A timeout does not settle a request or release its buffers. Before destroy, stop and join every publisher and waiter; SETTLED alone does not prove notification storage is reclaimable. arm snapshots the sequence. wait must atomically observe a changed sequence or a latched wake, including a wake between the caller's recheck and sleeping. A changed sequence cannot bypass a finite deadline: wait checks expiry on every call and every return from blocking before reporting a hint. A nonblocking backend may return BUSY while unexpired. Only one owner may arm/wait; a second concurrent wait is outside the port contract even when a backend rejects it.
| nx_result_t(* nx_wait_port_t::wait) (void *context, uint32_t sequence, uint64_t deadline_us) |
| nx_result_t(* nx_wait_port_t::wake) (void *context) |