|
6 | 6 | //! spinlocks, raw spinlocks) to be provided with minimal effort.
|
7 | 7 |
|
8 | 8 | use super::LockClassKey;
|
9 |
| -use crate::{bindings, init::PinInit, pin_init, str::CStr, types::Opaque, types::ScopeGuard}; |
10 |
| -use core::{cell::UnsafeCell, marker::PhantomData, marker::PhantomPinned}; |
| 9 | +use crate::{ |
| 10 | + bindings, |
| 11 | + init::PinInit, |
| 12 | + pin_init, |
| 13 | + str::CStr, |
| 14 | + types::ScopeGuard, |
| 15 | + types::{NotThreadSafe, Opaque}, |
| 16 | +}; |
| 17 | +use core::{cell::UnsafeCell, marker::PhantomPinned}; |
11 | 18 | use macros::pin_data;
|
12 | 19 |
|
13 | 20 | pub mod mutex;
|
@@ -132,7 +139,7 @@ impl<T: ?Sized, B: Backend> Lock<T, B> {
|
132 | 139 | pub struct Guard<'a, T: ?Sized, B: Backend> {
|
133 | 140 | pub(crate) lock: &'a Lock<T, B>,
|
134 | 141 | pub(crate) state: B::GuardState,
|
135 |
| - _not_send: PhantomData<*mut ()>, |
| 142 | + _not_send: NotThreadSafe, |
136 | 143 | }
|
137 | 144 |
|
138 | 145 | // SAFETY: `Guard` is sync when the data protected by the lock is also sync.
|
@@ -184,7 +191,7 @@ impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> {
|
184 | 191 | Self {
|
185 | 192 | lock,
|
186 | 193 | state,
|
187 |
| - _not_send: PhantomData, |
| 194 | + _not_send: NotThreadSafe, |
188 | 195 | }
|
189 | 196 | }
|
190 | 197 | }
|
0 commit comments