Ajout de Event.always
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1834 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
3fda2b9b90
commit
5d095a5e35
|
@ -127,6 +127,12 @@ let poll ev =
|
|||
|
||||
(* Event construction *)
|
||||
|
||||
let always data =
|
||||
Communication(fun performed condition evnum ->
|
||||
{ poll = (fun () -> performed := evnum; true);
|
||||
suspend = (fun () -> ());
|
||||
result = (fun () -> data) })
|
||||
|
||||
let send channel data =
|
||||
Communication(fun performed condition evnum ->
|
||||
let wcomm =
|
||||
|
|
|
@ -32,6 +32,9 @@ val receive: 'a channel -> 'a event
|
|||
(* [receive ch] returns the event consisting in receiving a value
|
||||
from the channel [ch]. The result value of this event is the
|
||||
value received. *)
|
||||
val always: 'a -> 'a event
|
||||
(* [always v] returns an event that is always ready for
|
||||
synchronization. The result value of this event is [v]. *)
|
||||
val choose: 'a event list -> 'a event
|
||||
(* [choose evl] returns the event that is the alternative of
|
||||
all the events in the list [evl]. *)
|
||||
|
|
Loading…
Reference in New Issue