Skip to content

Commit

Permalink
Remove obsolete second wakeup_paused
Browse files Browse the repository at this point in the history
It was introduced in d5822af.
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.
  • Loading branch information
Christopher Zimmermann committed Jan 4, 2022
1 parent 0fd7865 commit e2d8621
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/unix/lwt_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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. *)
Expand Down

0 comments on commit e2d8621

Please sign in to comment.