Skip to content

Commit 18d33b6

Browse files
committed
sim: fix regression from apache#14623
reason: work_timer_expiry may be called in thread context Signed-off-by: hujun5 <[email protected]>
1 parent 118f827 commit 18d33b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sched/wqueue/kwork_queue.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ static void work_timer_expiry(wdparm_t arg)
6868
{
6969
FAR struct work_s *work = (FAR struct work_s *)arg;
7070

71-
DEBUGASSERT(up_interrupt_context());
72-
7371
irqstate_t flags = spin_lock_irqsave(&work->wq->lock);
72+
sched_lock();
7473

7574
/* We have being canceled */
7675

@@ -80,6 +79,7 @@ static void work_timer_expiry(wdparm_t arg)
8079
}
8180

8281
spin_unlock_irqrestore(&work->wq->lock, flags);
82+
sched_unlock();
8383
}
8484

8585
static bool work_is_canceling(FAR struct kworker_s *kworkers, int nthreads,

0 commit comments

Comments
 (0)