kernel: work_q: Add an init function
k_work_queue_start receives a struct that is expected to be uninitialized (zeroed). Otherwise the behavior is undefined. Following the Zephyr semantics, this pr introduce a new init function for this struct. Fixes #36865 Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
fcf720941f
commit
d9aa414831
2 changed files with 22 additions and 0 deletions
|
@ -3045,6 +3045,17 @@ int k_work_cancel(struct k_work *work);
|
|||
*/
|
||||
bool k_work_cancel_sync(struct k_work *work, struct k_work_sync *sync);
|
||||
|
||||
/** @brief Initialize a work queue structure.
|
||||
*
|
||||
* This must be invoked before starting a work queue structure for the first time.
|
||||
* It need not be invoked again on the same work queue structure.
|
||||
*
|
||||
* @funcprops \isr_ok
|
||||
*
|
||||
* @param queue the queue structure to be initialized.
|
||||
*/
|
||||
void k_work_queue_init(struct k_work_q *queue);
|
||||
|
||||
/** @brief Initialize a work queue.
|
||||
*
|
||||
* This configures the work queue thread and starts it running. The function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue