|
6 | 6 | //! spinlocks, raw spinlocks) to be provided with minimal effort. |
7 | 7 |
|
8 | 8 | use super::LockClassKey; |
9 | | -use crate::{init::PinInit, pin_init, str::CStr, types::Opaque, types::ScopeGuard}; |
10 | | -use core::{cell::UnsafeCell, marker::PhantomData, marker::PhantomPinned}; |
| 9 | +use crate::{ |
| 10 | + init::PinInit, |
| 11 | + pin_init, |
| 12 | + str::CStr, |
| 13 | + types::{NotThreadSafe, Opaque, ScopeGuard}, |
| 14 | +}; |
| 15 | +use core::{cell::UnsafeCell, marker::PhantomPinned}; |
11 | 16 | use macros::pin_data; |
12 | 17 |
|
13 | 18 | pub mod mutex; |
@@ -139,7 +144,7 @@ impl<T: ?Sized, B: Backend> Lock<T, B> { |
139 | 144 | pub struct Guard<'a, T: ?Sized, B: Backend> { |
140 | 145 | pub(crate) lock: &'a Lock<T, B>, |
141 | 146 | pub(crate) state: B::GuardState, |
142 | | - _not_send: PhantomData<*mut ()>, |
| 147 | + _not_send: NotThreadSafe, |
143 | 148 | } |
144 | 149 |
|
145 | 150 | // SAFETY: `Guard` is sync when the data protected by the lock is also sync. |
@@ -191,7 +196,7 @@ impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> { |
191 | 196 | Self { |
192 | 197 | lock, |
193 | 198 | state, |
194 | | - _not_send: PhantomData, |
| 199 | + _not_send: NotThreadSafe, |
195 | 200 | } |
196 | 201 | } |
197 | 202 | } |
0 commit comments