Re: [PATCH v3 2/5] rust: sync: add WaitQueue infrastructure

From: Alice Ryhl

Date: Tue Nov 17 2026 - 09:16:59 EST


On Tue, Nov 17, 2026 at 01:14:43AM +0100, Danilo Krummrich wrote:
> Implement a wait queue wrapping the kernel's struct wait_queue_head,
> with wait_event()-style methods that take a condition closure directly.
>
> The API mirrors the C wait_event() family:
>
> - wait_event()
> - wait_event_interruptible()
> - wait_event_timeout()
> - wait_event_interruptible_timeout()
> - wake_up() / wake_up_all() / wake_up_sync()
>
> The interruptible variant returns Result<(), Interrupted>, the timeout
> variant Result<(), TimedOut>, and the combined variant Result<(),
> WaitError>. These errors map to ERESTARTSYS (signal) or ETIMEDOUT
> (timeout).
>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>

Thanks for addressing the feedback from v1!

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>

Alice