From e2d8621ccbc2b726833ad8fd8b75fb431220bf97 Mon Sep 17 00:00:00 2001 From: Christopher Zimmermann Date: Tue, 4 Jan 2022 22:11:47 +0100 Subject: [PATCH] Remove obsolete second wakeup_paused It was introduced in d5822af9a80b745515e0988541d7a43ed9a6faba. If I understand it correctly this was done to prevent calling select without timeout while there were pending paused promises. Since now we explicitely check for this condition and call select with zero timeout (`should_block_waiting_for_io`). This extra `wakeup_paused` seems to be obsolete. --- src/unix/lwt_main.ml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/unix/lwt_main.ml b/src/unix/lwt_main.ml index 0cac449b87..17ea3c5a1a 100644 --- a/src/unix/lwt_main.ml +++ b/src/unix/lwt_main.ml @@ -26,8 +26,6 @@ let abandon_yielded_and_paused () = let run p = let rec run_loop () = - (* Fulfill paused promises now. *) - Lwt.wakeup_paused (); match Lwt.poll p with | Some x -> x @@ -40,7 +38,7 @@ let run p = Lwt.paused_count () = 0 && Lwt_sequence.is_empty yielded in Lwt_engine.iter should_block_waiting_for_io; - (* Fulfill paused promises again. *) + (* Fulfill paused promises. *) Lwt.wakeup_paused (); (* Fulfill yield promises. *)