Skip to main content

Fence

Trait Fence 

Source
pub trait Fence: Sized {
    // Required method
    fn wait(self) -> Result<(), ServerError>;

    // Provided method
    fn sync(self) { ... }
}
Expand description

A synchronization primitive that blocks until the device has finished processing all commands submitted before the fence was created.

Required Methods§

Source

fn wait(self) -> Result<(), ServerError>

Block the current thread until the device signals this fence.

§Errors

The fault the wait reveals, when the stream itself failed.

Provided Methods§

Source

fn sync(self)

wait, ignoring a fault.

What the drop queue needs: it only has to know the device is done reading the memory it is about to free, and a stream that faulted is done either way. The fault reaches the caller through whatever it touches next.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<A: EventApi> Fence for EventFence<A>

Available on multi_threading only.

The drop queue is where a fence pays off — a freed host buffer waits on one rather than on the server — and it is multi_threading-only, so the impl is too. Everything above it is the same fence either way.