diff --git a/src/riot-rs-threads/src/thread_flags.rs b/src/riot-rs-threads/src/thread_flags.rs index cf629a105..f6f443bbf 100644 --- a/src/riot-rs-threads/src/thread_flags.rs +++ b/src/riot-rs-threads/src/thread_flags.rs @@ -71,10 +71,9 @@ impl Threads { fn flag_wait_all(&mut self, mask: ThreadFlags) -> Option { let thread = self.current().unwrap(); - if thread.flags & mask != 0 { - let result = thread.flags & mask; + if thread.flags & mask == mask { thread.flags &= !mask; - Some(result) + Some(mask) } else { let thread_id = thread.pid; self.set_state(thread_id, ThreadState::FlagBlocked(WaitMode::All(mask)));