Skip to main content

FenceCallback

Trait FenceCallback 

Source
pub trait FenceCallback: Send + 'static {
    // Required method
    fn on_signal(&mut self);
}
Expand description

Trait for callbacks that can be registered on fences.

When the fence signals, the callback will be invoked.

§Example

use kernel::dma_buf::FenceCallback;

struct MyCallback {
    // Your callback state here
}

impl FenceCallback for MyCallback {
    fn on_signal(&mut self) {
        pr_info!("Fence signaled!\n");
        // Handle fence completion
    }
}

Required Methods§

Source

fn on_signal(&mut self)

Called when the fence is signaled.

This is called from the fence signaling path, which may be in interrupt context or with locks held, which is why self is only borrowed, so that it cannot drop. Implementations must not sleep or perform long-running operations.

An implementation likely wants to inform itself (e.g., through a work item) within this callback that the associated FenceCallbackRegistration can now be dropped.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§