From 922f1ad0eb56d362e527ff28e456b6fa133e212b Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Fri, 27 Jan 2023 20:20:14 +0100 Subject: Added examples for async crates + fixed codegen for non-Copy arguments --- rtic-channel/src/wait_queue.rs | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'rtic-channel/src/wait_queue.rs') 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; -struct MyLinkPtr(UnsafeCell<*mut Link>); - -impl MyLinkPtr { - #[inline(always)] - fn new(val: *mut Link) -> 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 { - 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) { - unsafe { self.0.get().write(val) } - } -} - /// A FIFO linked list for a wait queue. pub struct LinkedList { head: AtomicPtr>, // UnsafeCell<*mut Link> -- cgit v1.2.3