module Thread:sig..end
type state =
| |
New |
(* | The thread has not been started. | *) |
| |
Runnable |
(* | The thread is executing. | *) |
| |
Blocked |
(* | The thread is blocked on a lock. | *) |
| |
Waiting |
(* | The thread is waiting for another thread (with no timeout). | *) |
| |
Timed_waiting |
(* | The thread is waiting for another thread (with a timeout). | *) |
| |
Terminated |
(* | The thread has terminated execution. | *) |
val max_priority : int32val min_priority : int32val norm_priority : int32type t
val make : ThreadGroup.t option -> string option -> ('a -> unit) -> 'a -> tmake g n f x returns a new thread in group g with name n. The
thread will execute f x when started.val current_thread : unit -> tval get_id : t -> int64val get_name : t -> stringval get_priority : t -> stringval get_state : t -> stateval get_thread_group : t -> ThreadGroup.t optionNone if the thread has terminated
its execution.val interrupt : t -> unitval interrupted : unit -> boolfalse.val is_alive : t -> boolval is_daemon : t -> boolval is_interrupted : t -> boolval join : t -> unit
Raises Runtime.Interrupted if the thread is interrupted.
val join_time : t -> int64 -> unitjoin_time t m is similar to join t, except that the current
thread will at most wait for m milliseconds.
Raises Invalid_argument if m is invalid.
Raises Runtime.Interrupted if the thread is interrupted.
val join_time_nanos : t -> int64 -> int32 -> unitjoin_time t m n is similar to join t, except that the current
thread will at most wait for m milliseconds plus n nanoseconds.
Raises Invalid_argument if m or n is invalid.
Raises Runtime.Interrupted if the thread is interrupted.
val set_daemon : t -> bool -> unit
Raises Invalid_argument if the thread has already been started.
val set_name : t -> string -> unitval set_priority : t -> int32 -> unit
Raises Invalid_argument if the priority is invalid.
val sleep : int64 -> unitsleep m waits for m milliseconds.
Raises Invalid_argument if m is invalid.
Raises Runtime.Interrupted if the thread is interrupted.
val sleep_nanos : int64 -> int32 -> unitsleep m n waits for m milliseconds plus n nanoseconds.
Raises Invalid_argument if m or n is invalid.
Raises Runtime.Interrupted if the thread is interrupted.
val start : t -> unit
Raises Invalid_argument if the thread has already been started.
val yield : unit -> unit