Re: [PATCH v3 1/3] rust: workqueue: impl Send and Sync for OwnedQueue

From: Daniel Almeida

Date: Mon Aug 10 2026 - 14:30:40 EST




> On 8 Jul 2026, at 08:43, Onur Özkan <work@xxxxxxxxxxxxx> wrote:
>
> Allows OwnedQueue to be used across thread boundaries which is needed
> from the tyr reset implementation.
>
> Signed-off-by: Onur Özkan <work@xxxxxxxxxxxxx>
> ---
> rust/kernel/workqueue/mod.rs | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/rust/kernel/workqueue/mod.rs b/rust/kernel/workqueue/mod.rs
> index 933032fc4a85..d766cd9b9175 100644
> --- a/rust/kernel/workqueue/mod.rs
> +++ b/rust/kernel/workqueue/mod.rs
> @@ -383,6 +383,14 @@ pub struct OwnedQueue {
> queue: NonNull<Queue>,
> }
>
> +// SAFETY: `OwnedQueue` has exclusive ownership of the workqueue and accesses to workqueues
> +// are thread safe as documented by the `Send` implementation for `Queue`.
> +unsafe impl Send for OwnedQueue {}
> +
> +// SAFETY: Shared access to an `OwnedQueue` only provides shared access to its `Queue` which
> +// is thread safe as documented by the `Sync` implementation for `Queue`.
> +unsafe impl Sync for OwnedQueue {}
> +
> impl Deref for OwnedQueue {
> type Target = Queue;
> fn deref(&self) -> &Queue {
> --
> 2.51.2
>
>

Reviewed-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>