summaryrefslogtreecommitdiff
path: root/src/util/fifo_queue.rs
diff options
context:
space:
mode:
authorChristian Cunningham <c@localhost>2022-08-26 18:21:37 -0700
committerChristian Cunningham <c@localhost>2022-08-26 18:21:37 -0700
commitc649f061c72af454199c5a2a9148c4867703da80 (patch)
tree72b61a2e13da78a0874aa0c4b747b10a3e18b77b /src/util/fifo_queue.rs
parent99ab7eadbc72eb0dc2dd776b83373a4b7035f3ea (diff)
Use lock
Diffstat (limited to 'src/util/fifo_queue.rs')
-rw-r--r--src/util/fifo_queue.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/util/fifo_queue.rs b/src/util/fifo_queue.rs
index 779bc9d..bb3d8b1 100644
--- a/src/util/fifo_queue.rs
+++ b/src/util/fifo_queue.rs
@@ -2,6 +2,9 @@
//!
//! Provides the FIFO queue structure for allocations
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_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 +34,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 }
}
}