Skip to content

Commit

Permalink
Auto merge of #3956 - RalfJung:epoll-ready-list, r=RalfJung
Browse files Browse the repository at this point in the history
epoll: rename blocking_epoll_callback since it is not just called after unblocking

`@tiif` does `return_ready_list` seem like a reasonable name?
  • Loading branch information
bors committed Oct 10, 2024
2 parents 29f68ed + cba4815 commit a79012b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/shims/unix/linux/epoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
}
if timeout == 0 || !ready_list_empty {
// If the ready list is not empty, or the timeout is 0, we can return immediately.
blocking_epoll_callback(epfd_value, weak_epfd, dest, &event, this)?;
return_ready_list(epfd_value, weak_epfd, dest, &event, this)?;
} else {
// Blocking
let timeout = match timeout {
Expand Down Expand Up @@ -509,7 +509,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
event: MPlaceTy<'tcx>,
}
@unblock = |this| {
blocking_epoll_callback(epfd_value, weak_epfd, &dest, &event, this)?;
return_ready_list(epfd_value, weak_epfd, &dest, &event, this)?;
interp_ok(())
}
@timeout = |this| {
Expand Down Expand Up @@ -636,8 +636,9 @@ fn check_and_update_one_event_interest<'tcx>(
}
}

/// Callback function after epoll_wait unblocks
fn blocking_epoll_callback<'tcx>(
/// Stores the ready list of the `epfd` epoll instance into `events` (which must be an array),
/// and the number of returned events into `dest`.
fn return_ready_list<'tcx>(
epfd_value: i32,
weak_epfd: WeakFileDescriptionRef,
dest: &MPlaceTy<'tcx>,
Expand Down

0 comments on commit a79012b

Please sign in to comment.