[#BloombergLP-bslmt-ThreadGroup]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::ThreadGroup
:relfileprefix: ../../
:mrdocs:

This class provides a simple mechanism for managing a group of joinable threads&period; The destructor ensures that any running threads are detached so that resources are not leaked&period; This class is thread&hyphen;enabled, thread&hyphen;safe, and exception&hyphen;neutral&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;threadgroup&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class ThreadGroup;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslmt/ThreadGroup/2constructor.adoc[`ThreadGroup`]         [.small]#[constructor]#
| Create an empty thread group&period; Optionally specify `basicAllocator` will be used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator will be used&period;
| xref:BloombergLP/bslmt/ThreadGroup/2destructor.adoc[`&#126;ThreadGroup`] [.small]#[destructor]#
| Destroy this object&period; Any threads not joined will be allowed to run independently, and will no longer be joinable&period;
| xref:BloombergLP/bslmt/ThreadGroup/addThread-017.adoc[`addThread`] 
| `addThread` overloads
| xref:BloombergLP/bslmt/ThreadGroup/addThreads-03.adoc[`addThreads`] 
| `addThreads` overloads
| xref:BloombergLP/bslmt/ThreadGroup/joinAll.adoc[`joinAll`] 
| Block the calling thread until all threads started in this group have finished executing&period;
| xref:BloombergLP/bslmt/ThreadGroup/numThreads.adoc[`numThreads`] 
| Return a snapshot of the number of threads started in this group that have not been joined&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
