diff options
Diffstat (limited to 'rust/kernel/regulator.rs')
-rw-r--r-- | rust/kernel/regulator.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rust/kernel/regulator.rs b/rust/kernel/regulator.rs index d56aa229e838..704147e18bfc 100644 --- a/rust/kernel/regulator.rs +++ b/rust/kernel/regulator.rs @@ -398,6 +398,14 @@ impl<T: RegulatorState> Drop for Regulator<T> { } } +// SAFETY: It is safe to send a `Regulator<T>` across threads. In particular, a +// Regulator<T> can be dropped from any thread. +unsafe impl<T: RegulatorState> Send for Regulator<T> {} + +// SAFETY: It is safe to send a &Regulator<T> across threads because the C side +// handles its own locking. +unsafe impl<T: RegulatorState> Sync for Regulator<T> {} + /// A voltage. /// /// This type represents a voltage value in microvolts. |