aboutsummaryrefslogtreecommitdiff
path: root/rtic-channel/src/wait_queue.rs
diff options
context:
space:
mode:
authorEmil Fresk <emil.fresk@gmail.com>2023-01-27 20:20:14 +0100
committerHenrik Tjäder <henrik@tjaders.com>2023-03-01 00:33:34 +0100
commit922f1ad0eb56d362e527ff28e456b6fa133e212b (patch)
tree81a66f352a6f10e28c702d4669f9bded7b42e5d1 /rtic-channel/src/wait_queue.rs
parentd23de6282365bbe83099e3d10877bdd435559016 (diff)
Added examples for async crates + fixed codegen for non-Copy arguments
Diffstat (limited to 'rtic-channel/src/wait_queue.rs')
-rw-r--r--rtic-channel/src/wait_queue.rs22
1 files changed, 0 insertions, 22 deletions
diff --git a/rtic-channel/src/wait_queue.rs b/rtic-channel/src/wait_queue.rs
index 90d762b..5b59983 100644
--- a/rtic-channel/src/wait_queue.rs
+++ b/rtic-channel/src/wait_queue.rs
@@ -1,6 +1,5 @@
//! ...
-use core::cell::UnsafeCell;
use core::marker::PhantomPinned;
use core::ptr::null_mut;
use core::sync::atomic::{AtomicPtr, Ordering};
@@ -9,27 +8,6 @@ use critical_section as cs;
pub type WaitQueue = LinkedList<Waker>;
-struct MyLinkPtr<T>(UnsafeCell<*mut Link<T>>);
-
-impl<T> MyLinkPtr<T> {
- #[inline(always)]
- fn new(val: *mut Link<T>) -> Self {
- Self(UnsafeCell::new(val))
- }
-
- /// SAFETY: Only use this in a critical section, and don't forget them barriers.
- #[inline(always)]
- unsafe fn load_relaxed(&self) -> *mut Link<T> {
- unsafe { *self.0.get() }
- }
-
- /// SAFETY: Only use this in a critical section, and don't forget them barriers.
- #[inline(always)]
- unsafe fn store_relaxed(&self, val: *mut Link<T>) {
- unsafe { self.0.get().write(val) }
- }
-}
-
/// A FIFO linked list for a wait queue.
pub struct LinkedList<T> {
head: AtomicPtr<Link<T>>, // UnsafeCell<*mut Link<T>>