Skip to content

Commit

Permalink
Implement Send and Sync for RwLock{Read,Write,Upgradable}Guard (#…
Browse files Browse the repository at this point in the history
…142)

This commit restores the auto trait implementations that have been
removed in commit 14ecef6.
  • Loading branch information
kawadakk committed Mar 13, 2023
1 parent 0facec0 commit ccb242a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ pub struct RwLockUpgradableGuard<'a, T: 'a + ?Sized, R = Spin> {
unsafe impl<T: ?Sized + Send, R> Send for RwLock<T, R> {}
unsafe impl<T: ?Sized + Send + Sync, R> Sync for RwLock<T, R> {}

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

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

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

impl<T, R> RwLock<T, R> {
/// Creates a new spinlock wrapping the supplied data.
///
Expand Down

0 comments on commit ccb242a

Please sign in to comment.