@@ -577,17 +577,22 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
577
577
if let Some ( epoll_interests) = this. machine . epoll_interests . get_epoll_interest ( id) {
578
578
for weak_epoll_interest in epoll_interests {
579
579
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
+ ) ?;
581
586
if is_updated {
582
587
// Edge-triggered notification only notify one thread even if there are
583
588
// 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 ( ) ;
586
590
587
591
// This unwrap can never fail because if the current epoll instance were
588
592
// closed and its epfd value reused, the upgrade of weak_epoll_interest
589
593
// above would fail. This guarantee holds because only the epoll instance
590
594
// holds a strong ref to epoll_interest.
595
+ // FIXME: We can randomly pick a thread to unblock.
591
596
if let Some ( thread_id) =
592
597
epfd. downcast :: < Epoll > ( ) . unwrap ( ) . thread_id . borrow_mut ( ) . pop ( )
593
598
{
@@ -628,7 +633,7 @@ fn ready_list_next(
628
633
629
634
/// This helper function checks whether an epoll notification should be triggered for a specific
630
635
/// 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
632
637
/// notification to only one epoll instance.
633
638
fn check_and_update_one_event_interest < ' tcx > (
634
639
fd_ref : & FileDescriptionRef ,
0 commit comments