diff --git a/src/no_std/node.rs b/src/no_std/node.rs index 9786574..78ba896 100644 --- a/src/no_std/node.rs +++ b/src/no_std/node.rs @@ -127,7 +127,9 @@ impl TaskWaiting { // If the entry ID is non-zero, then we are no longer queued. if self.status().is_some() { // Wake the task. - self.task.take().unwrap().wake(); + if let Some(task) = self.task.take() { + task.wake(); + } } } } diff --git a/src/no_std/queue.rs b/src/no_std/queue.rs index 0336269..379c556 100644 --- a/src/no_std/queue.rs +++ b/src/no_std/queue.rs @@ -58,6 +58,7 @@ impl Queue { // The head was set by another thread, so we need to try again. tail = self.tail.load(Ordering::Acquire); + continue; } unsafe {