runtime: allow benign timer race condition
this prevents a deadlock when a kthread is preempted while
holding the timer lock
@@ -151,15 +151,12 @@ uint64_t timer_earliest_deadline()
struct kthread *k = myk();
uint64_t deadline_us;
- spin_lock(&k->timer_lock);
-
+ /* deliberate race condition */
if (k->timern == 0)
deadline_us = 0;
else
deadline_us = k->timers[0].deadline_us;
- spin_unlock(&k->timer_lock);
-
return deadline_us;
}
