From d5822af9a80b745515e0988541d7a43ed9a6faba Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Tue, 4 May 2010 15:36:33 +0200 Subject: [PATCH] call Lwt.wakeup_paused before polling the thread in Lwt_main.run Ignore-this: 5f06d56e6d89d9b984f3ce41659beaa3 Otherwise, if the thread terminates in wakeup_paused, the scheduler may wait indefinitly for nothing. darcs-hash:20100504133633-c41ad-7976869aa57bc45fe37045a1dc9cd46defcf5ec9 --- src/unix/lwt_main.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/unix/lwt_main.ml b/src/unix/lwt_main.ml index ba69f3ee43..9aeef12c20 100644 --- a/src/unix/lwt_main.ml +++ b/src/unix/lwt_main.ml @@ -72,6 +72,7 @@ let default_iteration () = let main_loop_iteration = ref default_iteration let rec run t = + Lwt.wakeup_paused (); match Lwt.poll t with | Some x -> x