pub struct Task { /* private fields */ }Expand description
A handle to an OSAL task.
This is a wrapper around an osal_id_t that will automatically call
OS_TaskDelete when it goes out of scope, preventing resource leaks.
Implementations§
Source§impl Task
impl Task
Sourcepub fn new(
name: &str,
entry_point: unsafe extern "C" fn(),
stack_size: usize,
priority: u8,
flags: TaskFlags,
) -> Result<Self>
pub fn new( name: &str, entry_point: unsafe extern "C" fn(), stack_size: usize, priority: u8, flags: TaskFlags, ) -> Result<Self>
Creates a new OSAL task and starts it running.
The stack for the task is allocated from the system memory heap.
§Arguments
name: A unique string to identify the task.entry_point: The function that the new task will execute. This must be a free function withextern "C"linkage.stack_size: The size of the stack to allocate for the new task. A value of 0 is non-portable: some RTOS use a default, others create a task with no stack. Always specify an actual size.priority: The priority of the new task (0=highest, 255=lowest).flags: Task creation flags (e.g.TaskFlags::FP_ENABLED).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Task
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