diff --git a/sched/wqueue/kwork_notifier.c b/sched/wqueue/kwork_notifier.c index 813b46c0a55..8b3a3b5df40 100644 --- a/sched/wqueue/kwork_notifier.c +++ b/sched/wqueue/kwork_notifier.c @@ -360,8 +360,7 @@ void work_notifier_signal(enum work_evtype_e evtype, * the notifications have been sent. */ - flags = spin_lock_irqsave(&g_notifier_lock); - sched_lock(); + flags = spin_lock_irqsave_nopreempt(&g_notifier_lock); /* Process the notification at the head of the pending list until the * pending list is empty @@ -404,8 +403,7 @@ void work_notifier_signal(enum work_evtype_e evtype, } } - spin_unlock_irqrestore(&g_notifier_lock, flags); - sched_unlock(); + spin_unlock_irqrestore_nopreempt(&g_notifier_lock, flags); } #endif /* CONFIG_WQUEUE_NOTIFIER */ diff --git a/sched/wqueue/kwork_thread.c b/sched/wqueue/kwork_thread.c index 3d5008308a4..725461d76d2 100644 --- a/sched/wqueue/kwork_thread.c +++ b/sched/wqueue/kwork_thread.c @@ -211,8 +211,7 @@ static int work_thread(int argc, FAR char *argv[]) * so ourselves, and (2) there will be no changes to the work queue */ - flags = spin_lock_irqsave(&wqueue->lock); - sched_lock(); + flags = spin_lock_irqsave_nopreempt(&wqueue->lock); /* If the wqueue timer is expired and non-active, it indicates that * there might be expired work in the pending queue. @@ -247,16 +246,14 @@ static int work_thread(int argc, FAR char *argv[]) kworker->work = work; - spin_unlock_irqrestore(&wqueue->lock, flags); - sched_unlock(); + spin_unlock_irqrestore_nopreempt(&wqueue->lock, flags); /* Do the work. Re-enable interrupts while the work is being * performed... we don't have any idea how long this will take! */ CALL_WORKER(worker, arg); - flags = spin_lock_irqsave(&wqueue->lock); - sched_lock(); + flags = spin_lock_irqsave_nopreempt(&wqueue->lock); /* Mark the thread un-busy */ @@ -271,8 +268,7 @@ static int work_thread(int argc, FAR char *argv[]) } } - spin_unlock_irqrestore(&wqueue->lock, flags); - sched_unlock(); + spin_unlock_irqrestore_nopreempt(&wqueue->lock, flags); /* Wait for the semaphore to be posted by the wqueue timer. */