[#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 `<bslmt_threadutil.h>` Create a thread that invokes the specified function object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INVOKABLE> 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..._]# Create a thread that runs the specified entry‐point function. [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..._]# Same as the preceding overload, with the specified `attributes`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INVOKABLE> 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..._]# Same as the preceding overload, using the specified `attributes`. [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..._]# == Return Value 0 on success, and a non‐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]#