[#BloombergLP-bdlmt-MultipriorityThreadPool-drainJobs]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/MultipriorityThreadPool.adoc[MultipriorityThreadPool]::drainJobs
:relfileprefix: ../../../
:mrdocs:

Block until all executing and pending jobs complete&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
drainJobs();
----

== Description

Block until all executing jobs and pending jobs enqueued to this multi&hyphen;priority thread pool complete&period; This method does not affect the enabled&sol;disabled state of this thread pool&period; If this thread pool is enabled and jobs are enqueued during draining, this method may return before all enqueued jobs are executed&period; The behavior is undefined if&colon;

&ast; this method is called while this thread pool is stopped or suspended, or &ast; this method is called concurrently with a call to the `removeJobs` method, or &ast; this method is called by one of the threads belonging to this thread pool&period;

Note that, in these cases, such undefined behavior may include deadlock&period;


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