From 04e746967a81940d4cb97144f2d639c0632695ae Mon Sep 17 00:00:00 2001 From: ligd Date: Thu, 27 Jun 2024 19:09:00 +0800 Subject: [PATCH] wqueue: remove unused work_foreach() API Signed-off-by: ligd --- include/nuttx/wqueue.h | 19 -------------- sched/wqueue/kwork_thread.c | 49 ------------------------------------- 2 files changed, 68 deletions(-) diff --git a/include/nuttx/wqueue.h b/include/nuttx/wqueue.h index 78e72937e9..2e423e24b7 100644 --- a/include/nuttx/wqueue.h +++ b/include/nuttx/wqueue.h @@ -406,25 +406,6 @@ int work_cancel(int qid, FAR struct work_s *work); int work_cancel_sync(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 * diff --git a/sched/wqueue/kwork_thread.c b/sched/wqueue/kwork_thread.c index ef3be25b2f..f693a7f6c8 100644 --- a/sched/wqueue/kwork_thread.c +++ b/sched/wqueue/kwork_thread.c @@ -279,55 +279,6 @@ static int work_thread_create(FAR const char *name, int priority, * Public Functions ****************************************************************************/ -/**************************************************************************** - * 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) -{ - FAR struct kwork_wqueue_s *wqueue; - int nthread; - int wndx; - -#ifdef CONFIG_SCHED_HPWORK - if (qid == HPWORK) - { - wqueue = (FAR struct kwork_wqueue_s *)&g_hpwork; - nthread = CONFIG_SCHED_HPNTHREADS; - } - else -#endif -#ifdef CONFIG_SCHED_LPWORK - if (qid == LPWORK) - { - wqueue = (FAR struct kwork_wqueue_s *)&g_lpwork; - nthread = CONFIG_SCHED_LPNTHREADS; - } - else -#endif - { - return; - } - - for (wndx = 0; wndx < nthread; wndx++) - { - handler(wqueue->worker[wndx].pid, arg); - } -} - /**************************************************************************** * Name: work_start_highpri *