Skip to content

Commit

Permalink
Sort before dedup and add comment for Epoll's thread_id
Browse files Browse the repository at this point in the history
  • Loading branch information
tiif committed Aug 23, 2024
1 parent 4cfcb47 commit e0f60b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/shims/unix/linux/epoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct Epoll {
// This is an Rc because EpollInterest need to hold a reference to update
// it.
ready_list: Rc<RefCell<BTreeMap<(FdId, i32), EpollEventInstance>>>,
/// A list of thread ids blocked on this epoll instance.
thread_id: RefCell<Vec<ThreadId>>,
}

Expand Down Expand Up @@ -596,6 +597,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
}
}
}
waiter.sort();
waiter.dedup();
for thread_id in waiter {
this.unblock_thread(thread_id, BlockReason::Epoll)?;
Expand Down

0 comments on commit e0f60b8

Please sign in to comment.