pub struct WorkQueueBuilder { /* private fields */ }
Expand description
A builder for work queues themselves.
A work queue is a Zephyr thread that instead of directly running a piece of code, manages a work
queue. Various types of Work
can be submitted to these queues, along with various types of
triggering conditions.
Implementations§
Source§impl WorkQueueBuilder
impl WorkQueueBuilder
Sourcepub fn set_name(&mut self, name: &'static CStr) -> &mut Self
pub fn set_name(&mut self, name: &'static CStr) -> &mut Self
Set the name for the WorkQueue thread.
This name shows up in debuggers and some analysis tools.
Sourcepub fn set_no_yield(&mut self, value: bool) -> &mut Self
pub fn set_no_yield(&mut self, value: bool) -> &mut Self
Set the “no yield” flag for the created worker.
If this is not set, the work queue will call k_yield
between each enqueued work item. For
non-preemptible threads, this will allow other threads to run. For preemptible threads,
this will allow other threads at the same priority to run.
This method has a negative in the name, which goes against typical conventions. This is done to match the field in the Zephyr config.
Sourcepub fn set_essential(&mut self, value: bool) -> &mut Self
pub fn set_essential(&mut self, value: bool) -> &mut Self
Set the “essential” flag for the created worker.
This sets the essential flag on the running thread. The system considers the termination of an essential thread to be a fatal error.
Sourcepub fn set_priority(&mut self, value: c_int) -> &mut Self
pub fn set_priority(&mut self, value: c_int) -> &mut Self
Set the priority for the worker thread.
See the Zephyr docs for the meaning of priority.
Sourcepub fn start(&self, stack: ThreadStack) -> WorkQueue
pub fn start(&self, stack: ThreadStack) -> WorkQueue
Start the given work queue thread.
TODO: Implement a ‘start’ that works from a static work queue.