From f01d36c157ef79854522f1898a7719df35926d80 Mon Sep 17 00:00:00 2001 From: Andrej Mihajlov Date: Tue, 17 Dec 2024 19:42:55 +0100 Subject: [PATCH] Make queue sendable --- crates/dispatch2/src/queue.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/dispatch2/src/queue.rs b/crates/dispatch2/src/queue.rs index 898abb065..2de18e25f 100644 --- a/crates/dispatch2/src/queue.rs +++ b/crates/dispatch2/src/queue.rs @@ -124,6 +124,9 @@ pub struct Queue { is_workloop: bool, } +// Safety: dispatch queue can be safely moved between threads. +unsafe impl Send for Queue {} + impl Queue { /// Create a new [Queue]. pub fn new(label: &str, queue_attribute: QueueAttribute) -> Self {