Skip to content

Commit

Permalink
Implement Send and Sync for SpinMutexGuard (#143)
Browse files Browse the repository at this point in the history
This commit restores the auto trait implementations that have been
removed in commit 6eea725.
  • Loading branch information
kawadakk authored Mar 27, 2023
1 parent 2014dc3 commit d801e7c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mutex/spin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ pub struct SpinMutexGuard<'a, T: ?Sized + 'a> {
unsafe impl<T: ?Sized + Send, R> Sync for SpinMutex<T, R> {}
unsafe impl<T: ?Sized + Send, R> Send for SpinMutex<T, R> {}

unsafe impl<T: ?Sized + Sync> Sync for SpinMutexGuard<'_, T> {}
unsafe impl<T: ?Sized + Send> Send for SpinMutexGuard<'_, T> {}

impl<T, R> SpinMutex<T, R> {
/// Creates a new [`SpinMutex`] wrapping the supplied data.
///
Expand Down

0 comments on commit d801e7c

Please sign in to comment.