Trait RcuDefer

Source
pub unsafe trait RcuDefer {
    // Required method
    fn configure<F>(self: Box<Self>, func: F)
       where F: FnOnce(NonNull<c_void>, unsafe extern "C" fn(head: *mut c_void));
}
Expand description

This trait defines a callback to be invoked after the next RCU grace period.

§Implementation

Each RCU thread have an array of (callback, data) pointers. When the next RCU grace period finishes, the thread goes over each of its entry and execute callback(data).

§Safety

When RcuDefer::configure is called, you must deliberately leak your type (e.g. Box::into_raw) to prevent the memory from being freed. Upon execution of the callback, you must get back ownership (e.g. Box::from_raw) and properly free up memory. For an example, see RcuDeferFn.

Required Methods§

Source

fn configure<F>(self: Box<Self>, func: F)
where F: FnOnce(NonNull<c_void>, unsafe extern "C" fn(head: *mut c_void)),

Configures the callback for execution.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F, C> RcuDefer for RcuDeferFn<F, C>
where F: FnOnce(),