pub struct PlatformTask { /* private fields */ }Expand description
A spawned platform task plus the storage the platform tracks it in.
alloc-gated, and it is the ONLY thing in this module that is: it owns a
heap block sized from the platform’s own storage probes. The bare queries
beside it (stack_unused_bytes) allocate nothing and stay available to a
no-alloc image.
Joining is join rather than Drop, because both callers
have to signal their worker to stop BEFORE waiting for it — a Drop that
joined implicitly would deadlock against a worker still blocked on its own
wait.
Implementations§
Source§impl PlatformTask
impl PlatformTask
Sourcepub unsafe fn spawn(
entry: unsafe extern "C" fn(*mut c_void) -> *mut c_void,
arg: *mut c_void,
stack_bytes: usize,
name: *const i8,
) -> Option<PlatformTask>
pub unsafe fn spawn( entry: unsafe extern "C" fn(*mut c_void) -> *mut c_void, arg: *mut c_void, stack_bytes: usize, name: *const i8, ) -> Option<PlatformTask>
Sourcepub unsafe fn spawn_with(
entry: unsafe extern "C" fn(*mut c_void) -> *mut c_void,
arg: *mut c_void,
name: *const i8,
stack_bytes: usize,
priority: i64,
) -> Option<PlatformTask>
pub unsafe fn spawn_with( entry: unsafe extern "C" fn(*mut c_void) -> *mut c_void, arg: *mut c_void, name: *const i8, stack_bytes: usize, priority: i64, ) -> Option<PlatformTask>
Spawn entry(arg) stating a PRIORITY as well.
phase-359 W10 — spawn inherits the creating task’s priority, which is
right for the executor’s own workers and wrong for a TIER: a tier’s
priority is the thing its author declared. priority <= 0 means
“unstated” and inherits, matching how the board descriptors spell an
absent priority; anything positive is the kernel’s own number and is
passed through the band’s RAW escape hatch, because a
[tiers.<name>.<rtos>] priority is already in the kernel’s units.
§Safety
Same as spawn.
Trait Implementations§
Source§impl Drop for PlatformTask
Available on crate feature alloc only.
impl Drop for PlatformTask
alloc only.