diff options
| author | Mica White <botahamec@outlook.com> | 2024-03-11 22:09:33 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2024-03-11 22:09:33 -0400 |
| commit | 92ff1a5988cdea5851930e286fd8a0abfd744471 (patch) | |
| tree | e5ff0478051108ec6db6941b2af4ac340a578ce5 /src/rwlock | |
| parent | 84ebd3cf9be21bba8eb6c4d214c868e66965b69a (diff) | |
Fix trait bounds
Diffstat (limited to 'src/rwlock')
| -rw-r--r-- | src/rwlock/read_guard.rs | 10 | ||||
| -rw-r--r-- | src/rwlock/rwlock.rs | 2 | ||||
| -rw-r--r-- | src/rwlock/write_guard.rs | 10 |
3 files changed, 19 insertions, 3 deletions
diff --git a/src/rwlock/read_guard.rs b/src/rwlock/read_guard.rs index d8db9b9..074b0a9 100644 --- a/src/rwlock/read_guard.rs +++ b/src/rwlock/read_guard.rs @@ -46,7 +46,15 @@ impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> Self { rwlock: RwLockReadRef(rwlock), thread_key, - _phantom: PhantomData, + _phantom1: PhantomData, + _phantom2: PhantomData, } } } + +unsafe impl<'a, T: ?Sized + 'a, R: RawRwLock> Sync for RwLockReadRef<'a, T, R> {} + +unsafe impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> Sync + for RwLockReadGuard<'a, 'key, T, Key, R> +{ +} diff --git a/src/rwlock/rwlock.rs b/src/rwlock/rwlock.rs index b1c7ff0..b1c4def 100644 --- a/src/rwlock/rwlock.rs +++ b/src/rwlock/rwlock.rs @@ -370,4 +370,4 @@ impl<T: ?Sized, R: RawRwLock> RwLock<T, R> { } unsafe impl<R: RawRwLock + Send, T: ?Sized + Send> Send for RwLock<T, R> {} -unsafe impl<R: RawRwLock + Sync, T: ?Sized + Send + Sync> Sync for RwLock<T, R> {} +unsafe impl<R: RawRwLock + Sync, T: ?Sized + Send> Sync for RwLock<T, R> {} diff --git a/src/rwlock/write_guard.rs b/src/rwlock/write_guard.rs index dd168bf..9350425 100644 --- a/src/rwlock/write_guard.rs +++ b/src/rwlock/write_guard.rs @@ -63,7 +63,15 @@ impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> Self { rwlock: RwLockWriteRef(rwlock), thread_key, - _phantom: PhantomData, + _phantom1: PhantomData, + _phantom2: PhantomData, } } } + +unsafe impl<'a, T: ?Sized + 'a, R: RawRwLock> Sync for RwLockWriteRef<'a, T, R> {} + +unsafe impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> Sync + for RwLockWriteGuard<'a, 'key, T, Key, R> +{ +} |
