aboutsummaryrefslogtreecommitdiff
path: root/rtic-time/src/linked_list.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-04-09 14:48:26 +0000
committerGitHub <noreply@github.com>2023-04-09 14:48:26 +0000
commit2fb09d4a6da82a73572da7c7db132989b0dd4a49 (patch)
tree64d343d1acb22cb765ccc8ded0454a2d8f3e4b9d /rtic-time/src/linked_list.rs
parentd9f2980c388dc542f6c10d7de7879854067e4ba4 (diff)
parent66780d8a7b8e56627b31016ab43f83c631a16664 (diff)
Merge #727
727: Fix if a enqueued instant is first in a non-empty queue r=perlindgren a=korken89 Fixes #715 Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'rtic-time/src/linked_list.rs')
-rw-r--r--rtic-time/src/linked_list.rs5
1 files changed, 3 insertions, 2 deletions
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<T: PartialOrd + Clone> LinkedList<T> {
}
/// 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<T>>) -> (bool, usize) {
@@ -127,7 +128,7 @@ impl<T: PartialOrd + Clone> LinkedList<T> {
self.head
.store(val as *const _ as *mut _, Ordering::Relaxed);
- return (false, addr);
+ return (true, addr);
}
// 3. search list for correct place