Platform.THREAD
Cooperative threads.
val async : (unit -> 'a) -> 'a t
async f
creates a new thread of control which executes f ()
and returns the corresponding thread handle. The thread terminates whenever f ()
returns a value or raises an exception.
val await : 'a t -> ('a, [ `Async_exn of exn ]) Stdlib.result
await t
blocks on the termination of t
.
val return : 'a -> 'a t
return ()
is a pre-terminated thread handle.