diff options
Diffstat (limited to 'src/util/lifo_queue.rs')
| -rw-r--r-- | src/util/lifo_queue.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/util/lifo_queue.rs b/src/util/lifo_queue.rs index d63ca6e..cb0648b 100644 --- a/src/util/lifo_queue.rs +++ b/src/util/lifo_queue.rs @@ -2,6 +2,9 @@ //! //! Queue structure use crate::sync::interface::Mutex; +#[allow(unused_imports)] +use crate::sync::SpinLock; +#[allow(unused_imports)] use crate::sync::NullLock; use crate::util::node::*; use core::fmt; @@ -20,7 +23,7 @@ macro_rules! init_lifo_queue { (@gen [$name:tt,$size:tt,$default:tt,$type:ty,$doc:expr]) => { #[doc = $doc] #[link_section = ".data.alloc"] - pub static $name: LifoQueue<'static, $type, {$size+1}> = LifoQueue::new(NullLock::new([Node::new($default); {$size+1}])); + pub static $name: LifoQueue<'static, $type, {$size+1}> = LifoQueue::new(SpinLock::new([Node::new($default); {$size+1}])); }; } @@ -31,12 +34,12 @@ pub struct LifoQueue<'a, T: Sized, const COUNT: usize> { /// # Synchronized Pool of items /// /// Stores synchronization wrapper around the data pool - pub inner: NullLock<[Node<'a, T>; COUNT]>, + pub inner: SpinLock<[Node<'a, T>; COUNT]>, } impl<'a, T: Sized, const COUNT: usize> LifoQueue<'a, T, COUNT> { /// # Create new Lifo Queue - pub const fn new(initial: NullLock<[Node<'a, T>; COUNT]>) -> Self { + pub const fn new(initial: SpinLock<[Node<'a, T>; COUNT]>) -> Self { Self { inner: initial } } } |
