Skip to content

Commit

Permalink
os/wqueue : Enable interrupts at the end of work process
Browse files Browse the repository at this point in the history
The irqrestore is not needed before sigwait or usleep because
the context switch occurs during sigwait or usleep.
  • Loading branch information
YiHyunJin committed Aug 19, 2019
1 parent 4902642 commit 9a502b0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions os/wqueue/work_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ void work_process(FAR struct wqueue_s *wqueue, int wndx)
wqueue->delay = 0;
#if defined(CONFIG_SCHED_USRWORK) && !defined(__KERNEL__)
work_unlock();
#else
irqrestore(flags);
#endif
/* Wait indefinitely until signalled with SIGWORK */
wqueue->worker[wndx].busy = false;
Expand Down Expand Up @@ -301,19 +299,19 @@ void work_process(FAR struct wqueue_s *wqueue, int wndx)
*/
#if defined(CONFIG_SCHED_USRWORK) && !defined(__KERNEL__)
work_unlock();
#else
irqrestore(flags);
#endif
wqueue->worker[wndx].busy = false;
usleep(next * USEC_PER_TICK);
wqueue->worker[wndx].busy = true;
} else {
}
#if defined(CONFIG_SCHED_USRWORK) && !defined(__KERNEL__)
else {
work_unlock();
}
#else
irqrestore(flags);
irqrestore(flags);
#endif
}

}

#endif /* CONFIG_SCHED_WORKQUEUE */

0 comments on commit 9a502b0

Please sign in to comment.