Skip to content

Commit

Permalink
kernel: allow k_sleep(K_FOREVER)
Browse files Browse the repository at this point in the history
Threads that are sleeping forever may be woken up with
k_wakeup(), this shouldn't fail assertions.

Signed-off-by: Andrew Boie <[email protected]>
  • Loading branch information
Andrew Boie authored and nashif committed Jun 18, 2019
1 parent c5164f3 commit 3f97424
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,8 +961,6 @@ s32_t z_impl_k_sleep(int ms)
{
s32_t ticks;

__ASSERT(ms != K_FOREVER, "");

ticks = z_ms_to_ticks(ms);
ticks = z_tick_sleep(ticks);
return __ticks_to_ms(ticks);
Expand All @@ -971,12 +969,6 @@ s32_t z_impl_k_sleep(int ms)
#ifdef CONFIG_USERSPACE
Z_SYSCALL_HANDLER(k_sleep, ms)
{
/* FIXME there were some discussions recently on whether we should
* relax this, thread would be unscheduled until k_wakeup issued
*/
Z_OOPS(Z_SYSCALL_VERIFY_MSG(ms != K_FOREVER,
"sleeping forever not allowed"));

return z_impl_k_sleep(ms);
}
#endif
Expand Down

0 comments on commit 3f97424

Please sign in to comment.