File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -578,10 +578,6 @@ impl<'tcx> ThreadManager<'tcx> {
578
578
self . threads [ thread_id] . state . is_terminated ( )
579
579
}
580
580
581
- fn has_blocked_on_epoll ( & self , thread_id : ThreadId ) -> bool {
582
- self . threads [ thread_id] . state . is_blocked_on ( BlockReason :: Epoll )
583
- }
584
-
585
581
/// Have all threads terminated?
586
582
fn have_all_terminated ( & self ) -> bool {
587
583
self . threads . iter ( ) . all ( |thread| thread. state . is_terminated ( ) )
@@ -1141,12 +1137,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
1141
1137
this. machine . threads . enable_thread ( thread_id) ;
1142
1138
}
1143
1139
1144
- #[ inline]
1145
- fn has_blocked_on_epoll ( & self , thread_id : ThreadId ) -> bool {
1146
- let this = self . eval_context_ref ( ) ;
1147
- this. machine . threads . has_blocked_on_epoll ( thread_id)
1148
- }
1149
-
1150
1140
#[ inline]
1151
1141
fn active_thread_stack < ' a > ( & ' a self ) -> & ' a [ Frame < ' tcx , Provenance , FrameExtra < ' tcx > > ] {
1152
1142
let this = self . eval_context_ref ( ) ;
Original file line number Diff line number Diff line change @@ -509,6 +509,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
509
509
}
510
510
@timeout = |this| {
511
511
// No notification after blocking timeout.
512
+ let Some ( epfd) = weak_epfd. upgrade( ) else {
513
+ throw_unsup_format!( "epoll FD {epfd_value} got closed while blocking." )
514
+ } ;
515
+ // Remove the current active thread_id from the blocked thread_id list.
516
+ epfd. downcast:: <Epoll >( )
517
+ . ok_or_else( || err_unsup_format!( "non-epoll FD passed to `epoll_wait`" ) ) ?
518
+ . thread_id. borrow_mut( )
519
+ . retain( |& id| id != this. active_thread( ) ) ;
512
520
this. write_int( 0 , & dest) ?;
513
521
Ok ( ( ) )
514
522
}
@@ -605,9 +613,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
605
613
waiter. sort ( ) ;
606
614
waiter. dedup ( ) ;
607
615
for thread_id in waiter {
608
- if this. has_blocked_on_epoll ( thread_id) {
609
- this. unblock_thread ( thread_id, BlockReason :: Epoll ) ?;
610
- }
616
+ this. unblock_thread ( thread_id, BlockReason :: Epoll ) ?;
611
617
}
612
618
Ok ( ( ) )
613
619
}
You can’t perform that action at this time.
0 commit comments