Skip to content

Commit a4d7564

Browse files
committed
Fix error introduced by rebase
1 parent 7aff711 commit a4d7564

File tree

1 file changed

+9
-4
lines changed
  • src/tools/miri/src/shims/unix/linux

1 file changed

+9
-4
lines changed

src/tools/miri/src/shims/unix/linux/epoll.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,17 +577,22 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
577577
if let Some(epoll_interests) = this.machine.epoll_interests.get_epoll_interest(id) {
578578
for weak_epoll_interest in epoll_interests {
579579
if let Some(epoll_interest) = weak_epoll_interest.upgrade() {
580-
let is_updated = check_and_update_one_event_interest(fd_ref, epoll_interest, id, this)?;
580+
let is_updated = check_and_update_one_event_interest(
581+
fd_ref,
582+
epoll_interest.clone(),
583+
id,
584+
this,
585+
)?;
581586
if is_updated {
582587
// Edge-triggered notification only notify one thread even if there are
583588
// multiple threads block on the same epfd.
584-
let epfd = this.machine.fds.get(epoll_event_interest.epfd).unwrap();
585-
// FIXME: We can randomly pick a thread to unblock.
589+
let epfd = this.machine.fds.get(epoll_interest.borrow().epfd).unwrap();
586590

587591
// This unwrap can never fail because if the current epoll instance were
588592
// closed and its epfd value reused, the upgrade of weak_epoll_interest
589593
// above would fail. This guarantee holds because only the epoll instance
590594
// holds a strong ref to epoll_interest.
595+
// FIXME: We can randomly pick a thread to unblock.
591596
if let Some(thread_id) =
592597
epfd.downcast::<Epoll>().unwrap().thread_id.borrow_mut().pop()
593598
{
@@ -628,7 +633,7 @@ fn ready_list_next(
628633

629634
/// This helper function checks whether an epoll notification should be triggered for a specific
630635
/// epoll_interest and, if necessary, triggers the notification, and returns whether the
631-
/// event interest was updated. Unlike check_and_update_readiness, this function sends a
636+
/// notification was added/updated. Unlike check_and_update_readiness, this function sends a
632637
/// notification to only one epoll instance.
633638
fn check_and_update_one_event_interest<'tcx>(
634639
fd_ref: &FileDescriptionRef,

0 commit comments

Comments
 (0)