Re: [PATCH v3 4/5] rust: sync: condvar: use task::schedule_timeout()

From: Alice Ryhl

Date: Tue Nov 17 2026 - 09:17:13 EST


On Tue, Nov 17, 2026 at 01:14:45AM +0100, Danilo Krummrich wrote:
> @@ -122,7 +121,11 @@ fn wait_internal<T: ?Sized, B: Backend>(
> /// [`CondVar::notify_one`] or [`CondVar::notify_all`]. Note that it may also wake up
> /// spuriously.
> pub fn wait<T: ?Sized, B: Backend>(&self, guard: &mut Guard<'_, T, B>) {
> - self.wait_internal(TASK_UNINTERRUPTIBLE, guard, MAX_SCHEDULE_TIMEOUT);
> + self.wait_internal(
> + TASK_UNINTERRUPTIBLE,
> + guard,
> + Delta::from_jiffies(task::MAX_SCHEDULE_TIMEOUT),
> + );
> }

Now that `CondVar` uses `task::schedule_timeout()`, all remaining uses of
`task::MAX_SCHEDULE_TIMEOUT` wrap it in `Delta::from_jiffies(...)`, so we
could also change `MAX_SCHEDULE_TIMEOUT` itself to `Delta<Jiffy>` (either
if you spin a v4 or as a follow-up). Either way:

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>

Alice