#[repr(C)]pub struct ThreadExtensionOps {
pub on_switch_in: unsafe fn(data: usize, thread: ThreadId, policy: SchedulePolicy, charged_runtime_ns: u64),
pub on_switch_out: unsafe fn(data: usize, thread: ThreadId, reason: SwitchReason),
pub on_exit: unsafe fn(data: usize, thread: ThreadId),
pub on_deadline_overrun: unsafe fn(data: usize, thread: ThreadId),
pub drop: unsafe fn(data: usize),
}Expand description
OS-owned callbacks attached to a thread without exposing OS types.
Fields§
§on_switch_in: unsafe fn(data: usize, thread: ThreadId, policy: SchedulePolicy, charged_runtime_ns: u64)Invoked after the incoming thread becomes current. The runtime value is the rq-charged total before its new execution interval, allowing OS accounting to use the switch boundary without querying the registry.
on_switch_out: unsafe fn(data: usize, thread: ThreadId, reason: SwitchReason)Invoked after the thread stops being the current execution context.
on_exit: unsafe fn(data: usize, thread: ThreadId)Invoked in task context after the thread exits.
on_deadline_overrun: unsafe fn(data: usize, thread: ThreadId)Invoked in task context for requested Deadline overrun notification.
drop: unsafe fn(data: usize)Releases the OS-owned extension data in task or reaper context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ThreadExtensionOps
impl RefUnwindSafe for ThreadExtensionOps
impl Send for ThreadExtensionOps
impl Sync for ThreadExtensionOps
impl Unpin for ThreadExtensionOps
impl UnsafeUnpin for ThreadExtensionOps
impl UnwindSafe for ThreadExtensionOps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more