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

From: FUJITA Tomonori

Date: Tue Nov 17 2026 - 17:06:32 EST


On Tue, 17 Nov 2026 14:16:52 +0000
Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:

> 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>

serdev users need this value too. I was going to add
Delta::<Jiffy>::MAX for it, but this looks better.