Skip to content
Permalink
Browse files

kernel: allow k_sleep(K_FOREVER)

Threads that are sleeping forever may be woken up with
k_wakeup(), this shouldn't fail assertions.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
  • Loading branch information...
andrewboie authored and nashif committed Jun 11, 2019
1 parent c5164f3 commit 3f974243bed63a09f4e2ab09888d4ae1792dfb28
Showing with 0 additions and 8 deletions.
  1. +0 −8 kernel/sched.c
@@ -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);
@@ -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

0 comments on commit 3f97424

Please sign in to comment.
You can’t perform that action at this time.