BloombergLP::bslmt::ThreadUtil::createWithAllocator

createWithAllocator overloads

Synopses

Declared in <bslmt_threadutil.h>

Create a thread that invokes a function object using an allocator.

template<class INVOKABLE>
static
int
createWithAllocator(
    Handle* handle,
    INVOKABLE const& function,
    bslma::Allocator* allocator);
» more...

Create a thread that runs the specified entry-point using an allocator.

static
int
createWithAllocator(
    Handle* handle,
    ThreadFunction function,
    void* userData,
    bslma::Allocator* allocator);
» more...

Same as the preceding overload, with the specified attributes.

template<class INVOKABLE>
static
int
createWithAllocator(
    Handle* handle,
    ThreadAttributes const& attributes,
    INVOKABLE const& function,
    bslma::Allocator* allocator);
» more...

Create a thread with the specified attributes and allocator.

static
int
createWithAllocator(
    Handle* handle,
    ThreadAttributes const& attributes,
    ThreadFunction function,
    void* userData,
    bslma::Allocator* allocator);
» more...

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
handlereceives an identifier for the new thread
functioninvokable object executed as the thread entry point
allocatormemory allocator used to copy function
userDatasole argument passed to function
attributesproperties for the new thread