wqueue: add work_cancel_sync() support

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2023-08-28 19:29:54 +08:00
committed by Xiang Xiao
parent 978c8bd249
commit 61ef7eb3dc
4 changed files with 134 additions and 14 deletions
+23
View File
@@ -383,6 +383,29 @@ 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_cancel_sync
*
* Description:
* Blocked cancel previously queued user-mode work. This removes work
* from the user mode work queue. After work has been cancelled, it may
* be requeued by calling work_queue() again.
*
* Input Parameters:
* qid - The work queue ID (must be HPWORK or LPWORK)
* work - The previously queued work structure to cancel
*
* Returned Value:
* Zero (OK) on success, a negated errno on failure. This error may be
* reported:
*
* -ENOENT - There is no such work queued.
* -EINVAL - An invalid work queue was specified
*
****************************************************************************/
int work_cancel_sync(int qid, FAR struct work_s *work);
/****************************************************************************
* Name: work_foreach
*