diff --git a/kernel/futex.c b/kernel/futex.c index 1522a836..327d36ff 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -672,8 +672,11 @@ static uint64_t futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q */ xchg4(&(cpu_local_var(current)->status), PS_INTERRUPTIBLE); - /* Indicate spin sleep */ - if (!idle_halt) { + /* Indicate spin sleep. Note that schedule_timeout() with + * idle_halt should use spin sleep because sleep with timeout + * is not implemented. + */ + if (!idle_halt || timeout) { irqstate = ihk_mc_spinlock_lock(&thread->spin_sleep_lock); thread->spin_sleep = 1; ihk_mc_spinlock_unlock(&thread->spin_sleep_lock, irqstate);