A ThreadGroup can be understood as a counter which counts the number of
threads that were added to the group minus the ones that have terminated.
More formally a ThreadGroup has the following semantics:
new initializes the counter to 0.
Forking a thread increments the counter.
When a forked thread terminates, whether normally or by raising an exception, the counter is decremented.
nrOfRunning yields a transaction that returns the counter.
wait blocks as long as the counter is greater than 0.
waitN blocks as long as the counter is greater or equal to the specified number.
Instances1Eq
Eq ThreadGroupDefined in threads-0.5.1.8 · Control.Concurrent.Thread.Group