Skip to content

Commit

Permalink
add Lwt.waiter_of_wakener
Browse files Browse the repository at this point in the history
Ignore-this: 6a3ab84651cfaef9677b9ce503d655ad

darcs-hash:20101208162521-c41ad-1bf846856ed489467fd1178ad924e37a97865a84
  • Loading branch information
jeremiedimino committed Dec 8, 2010
1 parent fe7bdcd commit d996472
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ let task () =
} in
(thread t, wakener t)

let waiter_of_wakener wakener = thread (wakener_repr wakener)

(* apply function, reifying explicit exceptions into the thread type
apply: ('a -(exn)-> 'b t) -> ('a -(n)-> 'b t)
semantically a natural transformation TE -> T, where T is the thread
Expand Down
3 changes: 3 additions & 0 deletions src/core/lwt.mli
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ val wakeup_exn : 'a u -> exn -> unit
(** [wakeup_exn t e] makes the sleeping thread [t] fail with the
exception [e]. *)

val waiter_of_wakener : 'a u -> 'a t
(** Returns the thread associated to a wakener. *)

(** {6 Threads state} *)

(** State of a thread *)
Expand Down

0 comments on commit d996472

Please sign in to comment.