The spin_unlock() was called just before setting the expiry to
TICK_ETERNITY, so if another thread has the time to perform its
update and set a timeout, this would would clear it.
if (likely(tick_is_lt(now_ms, eb->key))) {
/* timer not expired yet, revisit it later */
t->exp_next = eb->key;
- SPIN_UNLOCK(STK_TABLE_LOCK, &t->lock);
- return t->exp_next;
+ goto out_unlock;
}
/* timer looks expired, detach it from the queue */
eb32_delete(&ts->upd);
__stksess_free(t, ts);
}
- SPIN_UNLOCK(STK_TABLE_LOCK, &t->lock);
/* We have found no task to expire in any tree */
t->exp_next = TICK_ETERNITY;
+out_unlock:
+ SPIN_UNLOCK(STK_TABLE_LOCK, &t->lock);
return t->exp_next;
}