[#BloombergLP-bdlmt-TimerEventScheduler-start-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/TimerEventScheduler.adoc[TimerEventScheduler]::start
:relfileprefix: ../../../
:mrdocs:

Begin dispatching events using the specified thread attributes&period;

== Synopsis

Declared in `&lt;bdlmt&lowbar;timereventscheduler&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
start(xref:BloombergLP/bslmt/ThreadAttributes.adoc[bslmt::ThreadAttributes] const& threadAttributes);
----

== Description

Begin dispatching events on this scheduler using the specified `threadAttributes` for the dispatcher thread (except that the DETACHED attribute is ignored)&period; Return 0 on success, and a nonzero value otherwise&period; If another thread is currently executing `stop`, wait until the dispatcher thread stops before starting a new one&period; If this scheduler has already started (and is not currently being stopped by another thread) then this invocation has no effect and 0 is returned&period; The created thread will use the name `threadAttributes&period;getThreadName()` if it is not empty, otherwise `eventSchedulerName` supplied at construction if it is not empty, otherwise &quot;bdl&period;TimerEvent&quot;&period; The behavior is undefined if this method is invoked in the dispatcher thread (i&period;e&period;, in a job executed by this scheduler)&period; Note that any event whose time has already passed is pending and will be dispatched immediately&period;

== Return Value

0 on success, and a nonzero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *threadAttributes*
| attributes for the dispatcher thread
|===


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