[#BloombergLP-bslmt-ThreadUtil-createWithAllocator-05]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/ThreadUtil.adoc[ThreadUtil]::createWithAllocator
:relfileprefix: ../../../
:mrdocs:

Same as the preceding overload, with the specified `attributes`&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;threadutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INVOKABLE&gt;
static
int
createWithAllocator(
    xref:BloombergLP/bslmt/ThreadUtil/Handle.adoc[Handle]* handle,
    xref:BloombergLP/bslmt/ThreadAttributes.adoc[ThreadAttributes] const& attributes,
    INVOKABLE const& function,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator);
----

== Return Value

0 on success, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *handle*
| receives an identifier for the new thread
| *attributes*
| properties for the new thread
| *function*
| invokable object executed as the thread entry point
| *allocator*
| memory allocator used to copy `function`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
