Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 4fcb360

Browse files
committed
Remove uneeded impl Send for TokenCell & doc upd.
1 parent 737e473 commit 4fcb360

File tree

1 file changed

+6
-6
lines changed
  • unified-scheduler-logic/src

1 file changed

+6
-6
lines changed

unified-scheduler-logic/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,13 @@ mod utils {
225225
}
226226
}
227227

228-
// Safety: Access to `TokenCell` is assumed to be only from a single thread by proper use of
229-
// Token once after `TokenCell` is sent to the thread from other threads; So, both implementing
230-
// Send and Sync can be thought as safe.
228+
// Safety: Once after a (`Send`-able) `TokenCell` is transferred to a thread from other
229+
// threads, access to `TokenCell` is assumed to be only from the single thread by proper use of
230+
// Token. Thereby, implementing `Sync` can be thought as safe and doing so is needed for the
231+
// particular implementation pattern in the unified scheduler (multi-threaded off-loading).
231232
//
232-
// In other words, TokenCell is technically still `!Send` and `!Sync`. But there should be no
233-
// legalized usage which depends on real `Send` and `Sync` to avoid undefined behaviors.
234-
unsafe impl<V> Send for TokenCell<V> {}
233+
// In other words, TokenCell is technically still `!Sync`. But there should be no
234+
// legalized usage which depends on real `Sync` to avoid undefined behaviors.
235235
unsafe impl<V> Sync for TokenCell<V> {}
236236

237237
/// A auxiliary zero-sized type to enforce aliasing rule to [`TokenCell`] via rust type system

0 commit comments

Comments
 (0)