[#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. The destructor ensures that any running threads are detached so that resources are not leaked. This class is thread‐enabled, thread‐safe, and exception‐neutral. == Synopsis Declared in `<bslmt_threadgroup.h>` [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. Optionally specify `basicAllocator` will be used to supply memory. If `basicAllocator` is 0, the currently installed default allocator will be used. | xref:BloombergLP/bslmt/ThreadGroup/2destructor.adoc[`~ThreadGroup`] [.small]#[destructor]# | Destroy this object. Any threads not joined will be allowed to run independently, and will no longer be joinable. | 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. | xref:BloombergLP/bslmt/ThreadGroup/numThreads.adoc[`numThreads`] | Return a snapshot of the number of threads started in this group that have not been joined. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#