|
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::{NotThreadSafe, Opaque, ScopeGuard}, |
| 15 | +}; |
| 16 | +use core::{cell::UnsafeCell, marker::PhantomPinned}; |
11 | 17 | use macros::pin_data;
|
12 | 18 |
|
13 | 19 | pub mod mutex;
|
@@ -139,7 +145,7 @@ impl<T: ?Sized, B: Backend> Lock<T, B> {
|
139 | 145 | pub struct Guard<'a, T: ?Sized, B: Backend> {
|
140 | 146 | pub(crate) lock: &'a Lock<T, B>,
|
141 | 147 | pub(crate) state: B::GuardState,
|
142 |
| - _not_send: PhantomData<*mut ()>, |
| 148 | + _not_send: NotThreadSafe, |
143 | 149 | }
|
144 | 150 |
|
145 | 151 | // SAFETY: `Guard` is sync when the data protected by the lock is also sync.
|
@@ -191,7 +197,7 @@ impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> {
|
191 | 197 | Self {
|
192 | 198 | lock,
|
193 | 199 | state,
|
194 |
| - _not_send: PhantomData, |
| 200 | + _not_send: NotThreadSafe, |
195 | 201 | }
|
196 | 202 | }
|
197 | 203 | }
|
0 commit comments