mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
workqueue: add work_foreach support
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -292,6 +292,10 @@ struct work_notifier_s
|
||||
worker_t worker; /* The worker function to schedule */
|
||||
};
|
||||
|
||||
/* This is the callback type used by work_foreach() */
|
||||
|
||||
typedef CODE void (*work_foreach_t)(int tid, FAR void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
@@ -381,6 +385,25 @@ int work_queue(int qid, FAR struct work_s *work, worker_t worker,
|
||||
|
||||
int work_cancel(int qid, FAR struct work_s *work);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: work_foreach
|
||||
*
|
||||
* Description:
|
||||
* Enumerate over each work thread and provide the tid of each task to a
|
||||
* user callback functions.
|
||||
*
|
||||
* Input Parameters:
|
||||
* qid - The work queue ID
|
||||
* handler - The function to be called with the pid of each task
|
||||
* arg - The function callback
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void work_foreach(int qid, work_foreach_t handler, FAR void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: work_available
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user