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 6, 2022
1 parent 0fd7865 commit eb0af2b
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 @@ -9,6 +9,10 @@
* Fix win32_spawn leaking dev_null fd in the parent process. (#906, Antonin Décimo)
* Prefer SetHandleInformation to DuplicateHandle in set_close_on_exec for sockets. DuplicateHandle mustn't be used on sockets. (#907, 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 eb0af2b

Please sign in to comment.