Skip to content

Commit

Permalink
threads: fix flag_wait_all
Browse files Browse the repository at this point in the history
  • Loading branch information
elenaf9 committed Mar 5, 2024
1 parent c24818a commit e2874a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/riot-rs-threads/src/thread_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ impl Threads {

fn flag_wait_all(&mut self, mask: ThreadFlags) -> Option<ThreadFlags> {
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)));
Expand Down

0 comments on commit e2874a9

Please sign in to comment.