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 authored and raphael-proust committed Jul 17, 2023
1 parent fc8edd6 commit 2265b65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@

* Alias Lwt_result.map_err and Lwt_result.bind_lwt_err to Lwt_result.map_error and Lwt_result.bind_lwt_error for consistency with Stdlib. (#927, Antonin Décimo)

====== Misc ======

* Resolve paused promises only once in main loop. This lets Lwt.pause behave identical to Lwt_unix.yield.(#917, Christopher Zimmermann)

===== 5.5.0 =====

====== Deprecations ======
Expand Down
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 2265b65

Please sign in to comment.