kernel: work_queue: make thread essential flag configurable
Allow the creator of a work_queue instance to choose whether the work_queue thread should be marked as ESSENTIAL or not. Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
This commit is contained in:
parent
2765d23775
commit
9ba4653243
|
@ -4004,6 +4004,11 @@ struct k_work_queue_config {
|
|||
* control.
|
||||
*/
|
||||
bool no_yield;
|
||||
|
||||
/** Control whether the work queue thread should be marked as
|
||||
* essential thread.
|
||||
*/
|
||||
bool essential;
|
||||
};
|
||||
|
||||
/** @brief A structure used to hold work until it can be processed. */
|
||||
|
|
|
@ -761,6 +761,10 @@ void k_work_queue_start(struct k_work_q *queue,
|
|||
k_thread_name_set(&queue->thread, cfg->name);
|
||||
}
|
||||
|
||||
if ((cfg != NULL) && (cfg->essential)) {
|
||||
queue->thread.base.user_options |= K_ESSENTIAL;
|
||||
}
|
||||
|
||||
k_thread_start(&queue->thread);
|
||||
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_work_queue, start, queue);
|
||||
|
|
Loading…
Reference in a new issue