pub struct AckWaiter { /* private fields */ }Expand description
The UI-thread side of an acknowledgment barrier: the UI thread
waits on this after sending a RenderCommand::Pause/
RenderCommand::SurfaceDestroyed, blocking until the render thread has
acknowledged (or dropped) the paired Ack.
Implementations§
Source§impl AckWaiter
impl AckWaiter
Sourcepub fn wait(self)
pub fn wait(self)
Block the UI thread until the render thread has acknowledged (or dropped)
the paired Ack. Returns immediately if already acknowledged. This is
the barrier: after it returns, the caller may safely proceed to release
the window (Android) or let the app background (iOS).
Sourcepub fn wait_timeout(self, timeout: Duration) -> bool
pub fn wait_timeout(self, timeout: Duration) -> bool
Block the UI thread until the render thread acknowledges the paired
Ack or timeout elapses, whichever comes first. Returns true if
the ack fired (the barrier was honored), false on timeout.
This is the bounded counterpart of Self::wait: the correctness fix
(receiver-liveness — see RenderReceiver’s Drop) means a live render
thread’s ack always fires, but a render thread wedged mid-command (a GPU
driver hang, not a clean exit) would still block Self::wait forever.
A timeout lets the caller degrade instead of hang — proceed to release
the window / let the app background after logging — so a stuck render
thread never trips a platform watchdog (iOS backgrounding kill, Android
ANR). Each call site picks a named, doc-commented per-platform deadline
safely under its watchdog budget.
Sourcepub fn completed(&self) -> bool
pub fn completed(&self) -> bool
Whether the paired Ack has been acknowledged yet, without blocking —
a non-consuming diagnostic peek (the barrier proper is Self::wait).