[#BloombergLP-bslmt-ThreadUtil-setThreadLimit] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/ThreadUtil.adoc[ThreadUtil]::setThreadLimit :relfileprefix: ../../../ :mrdocs: Enable a thread creation limit. If set to non‐zero value `n`'th thread creation will fail. The limit is disabled by setting the limit to 0. Only intended to be used in tests to inject thread creation errors. Note that this can be called multiple times to reset the thread limit, e.g. between subtests for example. == Synopsis Declared in `<bslmt_threadutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void setThreadLimit(unsigned int n); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#