[#BloombergLP-bslmt-ThreadGroup-addThread-017] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/ThreadGroup.adoc[ThreadGroup]::addThread :relfileprefix: ../../../ :mrdocs: `addThread` overloads == Synopses Declared in `<bslmt_threadgroup.h>` Begin executing the specified invokable `functor` in a new thread, using the optionally specified thread `attributes`. Return 0 on success, and a non‐zero value otherwise. `INVOKABLE` shall be a copy‐constructible type having the equivalent of `void operator()()`. Note that threads are always created joinable, regardless of the mode specified in `attributes`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INVOKABLE> int xref:BloombergLP/bslmt/ThreadGroup/addThread-01a.adoc[addThread](INVOKABLE const& functor); ---- [.small]#xref:BloombergLP/bslmt/ThreadGroup/addThread-01a.adoc[_» more..._]# Begin executing the specified invokable `functor` in a new thread, using the specified thread `attributes`. Return 0 on success, and a non‐zero value otherwise. `INVOKABLE` shall be a copy‐constructible type having the equivalent of `void operator()()`. Note that threads are always created joinable, regardless of the mode specified in `attributes`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INVOKABLE> int xref:BloombergLP/bslmt/ThreadGroup/addThread-0e.adoc[addThread]( INVOKABLE const& functor, xref:BloombergLP/bslmt/ThreadAttributes.adoc[ThreadAttributes] const& attributes); ---- [.small]#xref:BloombergLP/bslmt/ThreadGroup/addThread-0e.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#