BloombergLP::bslmt::ThreadGroup::addThreads

Same as the preceding overload, using the specified thread attributes.

Synopsis

Declared in <bslmt_threadgroup.h>

template<class INVOKABLE>
int
addThreads(
    INVOKABLE const& functor,
    int numThreads,
    ThreadAttributes const& attributes);

Description

Begin executing the specified invokable functor in the specified new numThreads, using the specified thread attributes. Return numThreads on success, or the number of threads successfully started 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.

Return Value

numThreads on success, or the number of threads successfully started otherwise

Parameters

NameDescription
functorinvokable object executed as the thread entry point
numThreadsnumber of new threads to start
attributesproperties for the new threads