We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae7bbbd commit 912cc49Copy full SHA for 912cc49
rayon-core/src/worker_local.rs
@@ -15,8 +15,10 @@ pub struct WorkerLocal<T> {
15
registry: Arc<Registry>,
16
}
17
18
-unsafe impl<T> Send for WorkerLocal<T> {}
19
-unsafe impl<T> Sync for WorkerLocal<T> {}
+/// We prevent concurrent access to the underlying value in the
+/// Deref impl, thus any values safe to send across threads can
20
+/// be used with WorkerLocal.
21
+unsafe impl<T: Send> Sync for WorkerLocal<T> {}
22
23
impl<T> WorkerLocal<T> {
24
/// Creates a new worker local where the `initial` closure computes the
0 commit comments