Skip to content

Commit

Permalink
epoll: rename blocking_epoll_callback since it is not just called aft…
Browse files Browse the repository at this point in the history
…er unblocking
  • Loading branch information
RalfJung committed Oct 9, 2024
1 parent ce9e1af commit cba4815
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 @@ -480,7 +480,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 @@ -508,7 +508,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 cba4815

Please sign in to comment.