File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -80,9 +80,14 @@ impl<T: Sync> Registration<T> {
80
80
81
81
// SAFETY: The only method is `register()`, which requires a (pinned) mutable `Registration`, so it
82
82
// is safe to pass `&Registration` to multiple threads because it offers no interior mutability,
83
- // except maybe through [ `Registration::context`] , but it is itself [ `Sync`] .
83
+ // except maybe through `Registration::context`, but it is itself `Sync`.
84
84
unsafe impl < T : Sync > Sync for Registration < T > { }
85
85
86
+ // SAFETY: All functions work from any thread. So as long as the `Registration::context` is
87
+ // `Send`, so is `Registration<T>`. `T` needs to be `Sync` because it's a requirement of
88
+ // `Registration<T>`.
89
+ unsafe impl < T : Send + Sync > Send for Registration < T > { }
90
+
86
91
impl < T : Sync > Drop for Registration < T > {
87
92
/// Removes the registration from the kernel if it has completed successfully before.
88
93
fn drop ( & mut self ) {
You can’t perform that action at this time.
0 commit comments