wqueue: update wqueue to support using wqueue before wqueue start

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2021-12-01 23:40:16 +08:00
committed by Xiang Xiao
parent 5c5bd7161c
commit 166a9210ca
2 changed files with 27 additions and 5 deletions
+12 -5
View File
@@ -73,13 +73,23 @@
#if defined(CONFIG_SCHED_HPWORK)
/* The state of the kernel mode, high priority work queue(s). */
struct hp_wqueue_s g_hpwork;
struct hp_wqueue_s g_hpwork =
{
{},
NXSEM_INITIALIZER(0, SEM_PRIO_NONE),
};
#endif /* CONFIG_SCHED_HPWORK */
#if defined(CONFIG_SCHED_LPWORK)
/* The state of the kernel mode, low priority work queue(s). */
struct lp_wqueue_s g_lpwork;
struct lp_wqueue_s g_lpwork =
{
{},
NXSEM_INITIALIZER(0, SEM_PRIO_NONE),
};
#endif /* CONFIG_SCHED_LPWORK */
/****************************************************************************
@@ -203,9 +213,6 @@ static int work_thread_create(FAR const char *name, int priority,
argv[0] = args;
argv[1] = NULL;
nxsem_init(&wqueue->sem, 0, 0);
nxsem_set_protocol(&wqueue->sem, SEM_PRIO_NONE);
/* Don't permit any of the threads to run until we have fully initialized
* g_hpwork and g_lpwork.
*/