From 66780d8a7b8e56627b31016ab43f83c631a16664 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sat, 8 Apr 2023 21:37:23 +0200 Subject: Fix if a enqueued instant is first in a non-empty queue --- rtic-time/src/linked_list.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'rtic-time/src/linked_list.rs') diff --git a/rtic-time/src/linked_list.rs b/rtic-time/src/linked_list.rs index d4256c9..c2a9967 100644 --- a/rtic-time/src/linked_list.rs +++ b/rtic-time/src/linked_list.rs @@ -92,7 +92,8 @@ impl LinkedList { } /// Insert a new link into the linked list. - /// The return is (was_empty, address), where the address of the link is for use with `delete`. + /// The return is (updated head, address), where the address of the link is for use + /// with `delete`. /// /// SAFETY: The pinned link must live until it is removed from this list. pub unsafe fn insert(&self, val: Pin<&Link>) -> (bool, usize) { @@ -127,7 +128,7 @@ impl LinkedList { self.head .store(val as *const _ as *mut _, Ordering::Relaxed); - return (false, addr); + return (true, addr); } // 3. search list for correct place -- cgit v1.2.3