Skip to main content

AckWaiter

Struct AckWaiter 

Source
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

Source

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).

Source

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.

Source

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).

Trait Implementations§

Source§

impl Debug for AckWaiter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.