mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user