diff options
| author | Fuwn <[email protected]> | 2022-01-03 14:18:04 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-01-03 14:18:04 -0800 |
| commit | 7a6afe8ba6f121ca230ba15e3c00d64e0c618a73 (patch) | |
| tree | 659e38709ade5ea470af48223edab70cb8001f25 /crates/windows-kernel-rs/src | |
| parent | fix(windows-kernel-rs): simplification (diff) | |
| download | driver-7a6afe8ba6f121ca230ba15e3c00d64e0c618a73.tar.xz driver-7a6afe8ba6f121ca230ba15e3c00d64e0c618a73.zip | |
fix(windows-kernel-rs): traits
Diffstat (limited to 'crates/windows-kernel-rs/src')
| -rw-r--r-- | crates/windows-kernel-rs/src/sync/fast_mutex.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/windows-kernel-rs/src/sync/fast_mutex.rs b/crates/windows-kernel-rs/src/sync/fast_mutex.rs index 9a82524..a45d576 100644 --- a/crates/windows-kernel-rs/src/sync/fast_mutex.rs +++ b/crates/windows-kernel-rs/src/sync/fast_mutex.rs @@ -26,15 +26,15 @@ use windows_kernel_sys::{ /// [`new`]: FastMutex::new /// [`lock`]: FastMutex::lock /// [`try_lock`]: FastMutex::try_lock -pub struct FastMutex<T: ?Sized> { +pub struct FastMutex<T: ?Sized + Send> { pub(crate) lock: Box<FAST_MUTEX>, pub(crate) data: UnsafeCell<T>, } -unsafe impl<T> Send for FastMutex<T> {} -unsafe impl<T> Sync for FastMutex<T> {} +unsafe impl<T: Send> Send for FastMutex<T> {} +unsafe impl<T: Send> Sync for FastMutex<T> {} -impl<T> FastMutex<T> { +impl<T: Send> FastMutex<T> { /// Creates a new mutex in an unlocked state ready for use. pub fn new(data: T) -> Self { let mut lock: Box<FAST_MUTEX> = Box::new(unsafe { core::mem::zeroed() }); @@ -98,11 +98,11 @@ impl<T> FastMutex<T> { } } -impl<T: ?Sized + Default> Default for FastMutex<T> { +impl<T: ?Sized + Default + Send> Default for FastMutex<T> { fn default() -> Self { Self::new(T::default()) } } -impl<T> From<T> for FastMutex<T> { +impl<T: Send> From<T> for FastMutex<T> { fn from(data: T) -> Self { Self::new(data) } } |