Skip to main content

apply_to_current_thread_under

Function apply_to_current_thread_under 

Source
pub fn apply_to_current_thread_under(
    policy: RtPolicy,
    priority: ThreadPriority,
) -> PriorityApplied
Expand description

apply_to_current_thread with the real-time policy supplied by the caller instead of read from the environment.

The single gate: RtPolicy::Disabled returns before any scheduler call is reachable. Exposed so a caller that already owns its RT policy (and the tests that must exercise both states in one process, since RtPolicy::current is cached) does not have to mutate the environment.