diff --git a/src/collections/mpmc_queue.rs b/src/collections/mpmc_queue.rs deleted file mode 100644 index 41e21da3830e9feef648a4f20eb70e05716045fc..0000000000000000000000000000000000000000 --- a/src/collections/mpmc_queue.rs +++ /dev/null @@ -1,31 +0,0 @@ -use std::sync::Mutex; -use std::collections::VecDeque; - -/// Generic multiple-producer, multiple-consumer queue. Current implementation -/// has the required functionality, without all of the optimizations. -/// TODO: @Optimize -pub struct MpmcQueue { - queue: Mutex>, -} - -impl MpmcQueue { - pub fn new() -> Self { - Self::with_capacity(0) - } - - pub fn with_capacity(capacity: usize) -> Self { - Self{ - queue: Mutex::new(VecDeque::with_capacity(capacity)), - } - } - - pub fn push_back(&self, item: T) { - let mut queue = self.queue.lock().unwrap(); - queue.push_back(item); - } - - pub fn pop_front(&self) -> Option { - let mut queue = self.queue.lock().unwrap(); - return queue.pop_front(); - } -} \ No newline at end of file