[#BloombergLP-bslmt-ThreadUtil-create-0e78]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/ThreadUtil.adoc[ThreadUtil]::create
:relfileprefix: ../../../
:mrdocs:

`create` overloads

== Synopses

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

Create a thread that invokes the specified function object&period;


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

[.small]#xref:BloombergLP/bslmt/ThreadUtil/create-041.adoc[_» more&period;&period;&period;_]#

Create a thread that runs the specified entry&hyphen;point function&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bslmt/ThreadUtil/create-0e7c.adoc[create](
    xref:BloombergLP/bslmt/ThreadUtil/Handle.adoc[Handle]* handle,
    xref:BloombergLP/bslmt/ThreadUtil/ThreadFunction.adoc[ThreadFunction] function,
    void* userData);
----

[.small]#xref:BloombergLP/bslmt/ThreadUtil/create-0e7c.adoc[_» more&period;&period;&period;_]#

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


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

[.small]#xref:BloombergLP/bslmt/ThreadUtil/create-047.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bslmt/ThreadUtil/create-0d.adoc[create](
    xref:BloombergLP/bslmt/ThreadUtil/Handle.adoc[Handle]* handle,
    xref:BloombergLP/bslmt/ThreadAttributes.adoc[ThreadAttributes] const& attributes,
    xref:BloombergLP/bslmt/ThreadUtil/ThreadFunction.adoc[ThreadFunction] function,
    void* userData);
----

[.small]#xref:BloombergLP/bslmt/ThreadUtil/create-0d.adoc[_» more&period;&period;&period;_]#

== 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
| *function*
| invokable object executed as the thread entry point
| *userData*
| sole argument passed to `function`
| *attributes*
| properties for the new thread
|===


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