wqueue: change single queue to double queue to improve speed

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2022-08-17 15:55:03 +08:00
committed by Petro Karashchenko
parent 2cc3ec57ef
commit 4a87578bdb
9 changed files with 24 additions and 24 deletions
+4 -4
View File
@@ -50,7 +50,7 @@
static void hp_work_timer_expiry(wdparm_t arg)
{
irqstate_t flags = enter_critical_section();
sq_addlast((FAR sq_entry_t *)arg, &g_hpwork.q);
dq_addlast((FAR dq_entry_t *)arg, &g_hpwork.q);
nxsem_post(&g_hpwork.sem);
leave_critical_section(flags);
}
@@ -64,7 +64,7 @@ static void hp_work_timer_expiry(wdparm_t arg)
static void lp_work_timer_expiry(wdparm_t arg)
{
irqstate_t flags = enter_critical_section();
sq_addlast((FAR sq_entry_t *)arg, &g_lpwork.q);
dq_addlast((FAR dq_entry_t *)arg, &g_lpwork.q);
nxsem_post(&g_lpwork.sem);
leave_critical_section(flags);
}
@@ -134,7 +134,7 @@ int work_queue(int qid, FAR struct work_s *work, worker_t worker,
if (!delay)
{
sq_addlast((FAR sq_entry_t *)work, &g_hpwork.q);
dq_addlast((FAR dq_entry_t *)work, &g_hpwork.q);
nxsem_post(&g_hpwork.sem);
}
else
@@ -152,7 +152,7 @@ int work_queue(int qid, FAR struct work_s *work, worker_t worker,
if (!delay)
{
sq_addlast((FAR sq_entry_t *)work, &g_lpwork.q);
dq_addlast((FAR dq_entry_t *)work, &g_lpwork.q);
nxsem_post(&g_lpwork.sem);
}
else