Skip to content

Commit

Permalink
sim: fix regression from #14623
Browse files Browse the repository at this point in the history
reason:
work_timer_expiry may be called in thread context

Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Jan 17, 2025
1 parent 118f827 commit 18d33b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sched/wqueue/kwork_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ static void work_timer_expiry(wdparm_t arg)
{
FAR struct work_s *work = (FAR struct work_s *)arg;

DEBUGASSERT(up_interrupt_context());

irqstate_t flags = spin_lock_irqsave(&work->wq->lock);
sched_lock();

/* We have being canceled */

Expand All @@ -80,6 +79,7 @@ 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,
Expand Down

0 comments on commit 18d33b6

Please sign in to comment.