Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix Lwt_fiber fast path #3

Merged
merged 1 commit into from

2 participants

@avsm

fix fast-path in Lwt_fiber: if an await returns immediately then restore active_prompt before returning to the fiber.

This lets me call await (Lwt.return ()) multiple times from inside Lwt_fiber.start

@jaked jaked merged commit 48116cf into jaked:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 17, 2011
  1. @avsm

    fix fast-path in Lwt_fiber: if an await returns immediately then rest…

    avsm authored
    …ore active_prompt before returning to the fiber
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/lwt-fiber/lwt_fiber.ml
View
2  src/lwt-fiber/lwt_fiber.ml
@@ -22,11 +22,11 @@ let await t =
match !active_prompt with
| None -> failwith "await called outside start"
| Some p -> p in
- active_prompt := None;
match Lwt.poll t with
| Some v -> v
| None ->
+ active_prompt := None;
Delimcc.shift0 p begin fun k ->
let ready _ =
active_prompt := Some p;
Something went wrong with that request. Please try again.