Skip to content

Commit

Permalink
give chance to terminate in wait_for_sys too (was just check_for_sys)
Browse files Browse the repository at this point in the history
  • Loading branch information
gares committed Nov 6, 2024
1 parent b583d02 commit 36a4c1a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/sel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ let rec wait_for_system_or_queue_events ~deadline (fds,sys) queue =
let ready_sys, waiting_sys, min_prio_sys = pull_ready ~advance:advance_system ready_fds sys in
let ready_queue, waiting_queue, min_prio_queue = pull_ready ~advance:advance_queue () queue in
if ready_sys <> Sorted.nil || ready_queue <> Sorted.nil
then ready_sys, ready_queue, waiting_sys, waiting_queue, Sorted.min_priority min_prio_queue min_prio_sys
then
let min_prio = Sorted.min_priority min_prio_queue min_prio_sys in
let new_ready_sys, waiting_sys, min_prio_new_ready_sys = check_for_system_events min_prio waiting_sys in
Sorted.append new_ready_sys ready_sys, ready_queue, waiting_sys, waiting_queue, Sorted.min_priority min_prio_new_ready_sys min_prio
else wait_for_system_or_queue_events ~deadline (fds,waiting_sys) queue

let wait_for_system_or_queue_events ~deadline sys queue =
Expand Down

0 comments on commit 36a4c1a

Please sign in to comment.