Module ThreadGroup

module ThreadGroup: sig .. end
Thread groups.

type t
The type of thread groups, that are sets of threads organized into a hierarchy (every group except the initial one has a parent).

Threads are added to a group at creation time and cannot change group afterwards.
 
val make : t option -> string -> t
Returns a new group with optional parent, and name.
 
val active_count : t -> int32
Returns the number of active threads in this group (including children groups).
 
val active_group_count : t -> int32
Returns the number of active groups in this group (including children groups).
 
val destroy : t -> unit
Destroys the passed group and all its children groups.

Raises Invalid_argument if the thread group is not empty, or has already been destroyed.
 
val get_max_priority : t -> int32
Returns the maximum priority of the group.
 
val get_name : t -> string
Returns the name of the group.
 
val get_parent : t -> t option
Returns the parent of the group, None if no such group exists.
 
val interrupt : t -> unit
Interrupts all thread in the group (including children groups).
 
val is_daemon : t -> bool
Tests whether the group is a daemon one.
 
val is_destroyed : t -> bool
Tests whether the group has been destroyed.
 
val parent_of : t -> t -> bool
parent_of p c tests whether p is an ancestor of c.
 
val set_daemon : t -> bool -> unit
Sets the daemon status of the group. Daemon groups are automatically destroyed when they have neither child group, nor running thread.
 
val set_max_priority : t -> int32 -> unit
Sets the maximum priority of the group.