Skip to main content

install_port_park

Function install_port_park 

Source
pub fn install_port_park(
    executor: &mut Executor<'_>,
    park: unsafe extern "C" fn(*mut c_void, u64) -> i8,
    granularity_us: u64,
) -> bool
Expand description

Install park on executor, waiting on the executor’s own wake object. The park is its worker’s (phase-509 P6, RFC-0108 D7): the one-level executor has one worker, and a worker of a scheduler with several levels parks on its own wake object, which only its band’s arrivals signal.

Returns false — and installs nothing — when this build has no wake object to park on. That build keeps the millisecond wake_wait_ms path it already had, which is why every caller can treat this as advisory.

granularity_us is the finest park the primitive can express. The PORT states it, because only the port knows: an RTOS tick is a coarser limit than the ABI signature (ThreadX ticks at 100 Hz) and a timespec primitive a finer one (issue 1242).