about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-10-10 06:21:22 +0000
committerbors <bors@rust-lang.org>2024-10-10 06:21:22 +0000
commitc7bfc445168a2231f32cc3fe8a920116e8c27dd3 (patch)
treece417fd68b9b2f9317163ecd0ed02bb96b87512b /src/tools
parent66fda4a8469464c428e750c5503953f52f14023e (diff)
parent7a9a9cba3f02445e2e1f3d34b31a588405cf68a9 (diff)
downloadrust-c7bfc445168a2231f32cc3fe8a920116e8c27dd3.tar.gz
rust-c7bfc445168a2231f32cc3fe8a920116e8c27dd3.zip
Auto merge of #3956 - RalfJung:epoll-ready-list, r=RalfJung
epoll: rename blocking_epoll_callback since it is not just called after unblocking

`@tiif` does `return_ready_list` seem like a reasonable name?
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/miri/src/shims/unix/linux/epoll.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tools/miri/src/shims/unix/linux/epoll.rs b/src/tools/miri/src/shims/unix/linux/epoll.rs
index 9ff7dbbdf84..cafc7161d26 100644
--- a/src/tools/miri/src/shims/unix/linux/epoll.rs
+++ b/src/tools/miri/src/shims/unix/linux/epoll.rs
@@ -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 {
@@ -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| {
@@ -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>,