No need to call sched_lock explicitly after call spin_lock_irqsave, since it will be called in func spin_lock_irqsave.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
This commit is contained in:
wangzhi16
2025-01-24 14:42:00 +08:00
committed by Xiang Xiao
parent 1655537810
commit 8f3a2a6f76
5 changed files with 0 additions and 14 deletions
-2
View File
@@ -115,7 +115,6 @@ static int adjtime_start(long long adjust_usec)
}
flags = spin_lock_irqsave(&g_adjtime_lock);
sched_lock();
/* Set new adjustment */
@@ -142,7 +141,6 @@ static int adjtime_start(long long adjust_usec)
}
spin_unlock_irqrestore(&g_adjtime_lock, flags);
sched_unlock();
return ret;
}
-2
View File
@@ -840,7 +840,6 @@ void _assert(FAR const char *filename, int linenum,
if (os_ready)
{
flags = spin_lock_irqsave(&g_assert_lock);
sched_lock();
}
#if CONFIG_BOARD_RESET_ON_ASSERT < 2
@@ -914,6 +913,5 @@ void _assert(FAR const char *filename, int linenum,
if (os_ready)
{
spin_unlock_irqrestore(&g_assert_lock, flags);
sched_unlock();
}
}
-3
View File
@@ -31,7 +31,6 @@
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <sched.h>
#include <assert.h>
#include <nuttx/arch.h>
@@ -361,7 +360,6 @@ void work_notifier_signal(enum work_evtype_e evtype,
*/
flags = spin_lock_irqsave(&g_notifier_lock);
sched_lock();
/* Process the notification at the head of the pending list until the
* pending list is empty
@@ -405,7 +403,6 @@ void work_notifier_signal(enum work_evtype_e evtype,
}
spin_unlock_irqrestore(&g_notifier_lock, flags);
sched_unlock();
}
#endif /* CONFIG_WQUEUE_NOTIFIER */
-4
View File
@@ -69,7 +69,6 @@ static void work_timer_expiry(wdparm_t arg)
FAR struct work_s *work = (FAR struct work_s *)arg;
irqstate_t flags = spin_lock_irqsave(&work->wq->lock);
sched_lock();
/* We have being canceled */
@@ -79,7 +78,6 @@ static void work_timer_expiry(wdparm_t arg)
}
spin_unlock_irqrestore(&work->wq->lock, flags);
sched_unlock();
}
static bool work_is_canceling(FAR struct kworker_s *kworkers, int nthreads,
@@ -184,10 +182,8 @@ int work_queue_wq(FAR struct kwork_wqueue_s *wqueue,
if (!delay)
{
sched_lock();
queue_work(wqueue, work);
spin_unlock_irqrestore(&wqueue->lock, flags);
sched_unlock();
}
else
{
-3
View File
@@ -27,7 +27,6 @@
#include <nuttx/config.h>
#include <unistd.h>
#include <sched.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -205,9 +204,7 @@ static int work_thread(int argc, FAR char *argv[])
while (kworker->wait_count > 0)
{
kworker->wait_count--;
sched_lock();
nxsem_post(&kworker->wait);
sched_unlock();
}
}