Nexus Embedded Platform 0.1.0
Statically assembled reusable embedded mechanisms
Loading...
Searching...
No Matches
nx_wait_port_t Struct Reference

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)

Detailed Description

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.

Definition at line 42 of file wait.h.

Field Documentation

◆ arm

uint32_t(* nx_wait_port_t::arm) (void *context)

Definition at line 44 of file wait.h.

◆ context

void* nx_wait_port_t::context

Definition at line 43 of file wait.h.

◆ wait

nx_result_t(* nx_wait_port_t::wait) (void *context, uint32_t sequence, uint64_t deadline_us)

Definition at line 45 of file wait.h.

◆ wake

nx_result_t(* nx_wait_port_t::wake) (void *context)

Definition at line 46 of file wait.h.


The documentation for this struct was generated from the following file: