diff options
| author | Christian Cunningham <c@localhost> | 2022-08-26 18:07:37 -0700 |
|---|---|---|
| committer | Christian Cunningham <c@localhost> | 2022-08-26 18:07:37 -0700 |
| commit | d50d0fece79a59ac1148f1c8fb448b62aab32094 (patch) | |
| tree | 2ee82b0e2eed74dd323947ac6283a72161081fd2 /src | |
| parent | 2fa911d48f2a3d963eb6683a3633a5d52154e9a5 (diff) | |
Use spin lock by default
Diffstat (limited to 'src')
| -rw-r--r-- | src/util/fifo_queue.rs | 8 | ||||
| -rw-r--r-- | src/util/lifo_queue.rs | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/util/fifo_queue.rs b/src/util/fifo_queue.rs index 779bc9d..9c0874d 100644 --- a/src/util/fifo_queue.rs +++ b/src/util/fifo_queue.rs @@ -2,7 +2,7 @@ //! //! Provides the FIFO queue structure for allocations use crate::sync::interface::Mutex; -use crate::sync::NullLock; +use crate::sync::SpinLock; use crate::util::node::*; use core::fmt; use core::fmt::{Debug, Formatter}; @@ -20,7 +20,7 @@ macro_rules! init_fifo_queue { (@gen [$name:tt,$size:tt,$default:tt,$type:ty,$doc:expr]) => { #[doc = $doc] #[link_section = ".data.alloc"] - pub static $name: FifoQueue<'static, $type, {$size+1}> = FifoQueue::new(NullLock::new([Node::new($default); {$size+1}])); + pub static $name: FifoQueue<'static, $type, {$size+1}> = FifoQueue::new(SpinLock::new([Node::new($default); {$size+1}])); }; } @@ -31,12 +31,12 @@ pub struct FifoQueue<'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> FifoQueue<'a, T, COUNT> { /// # Create new Fifo 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 } } } diff --git a/src/util/lifo_queue.rs b/src/util/lifo_queue.rs index d63ca6e..3a08076 100644 --- a/src/util/lifo_queue.rs +++ b/src/util/lifo_queue.rs @@ -2,7 +2,7 @@ //! //! Queue structure use crate::sync::interface::Mutex; -use crate::sync::NullLock; +use crate::sync::SpinLock; use crate::util::node::*; use core::fmt; use core::fmt::{Debug, Formatter}; @@ -20,7 +20,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 +31,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 } } } |
