Skip to main content

ExternalQueueLock

Trait ExternalQueueLock 

Source
pub trait ExternalQueueLock:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn lock(&self);
    fn unlock(&self);
}
Expand description

Serializes queue access with another API that shares the same queue.

A queue must be externally synchronized. When a native decoder submits to the same queue as the renderer, both sides have to take one lock, and neither owns the other’s submissions. GpuContext takes it around every call that can reach the native queue, not only submissions. Implementations must be re-entrant: one thread can submit while already holding the lock, for example when a queue-completion callback releases a resource.

Required Methods§

Source

fn lock(&self)

Acquires exclusive access to the shared queue.

Source

fn unlock(&self)

Releases access taken by ExternalQueueLock::lock.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§