[#BloombergLP-bdlmt-MultiQueueThreadPool-drainQueue]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/MultiQueueThreadPool.adoc[MultiQueueThreadPool]::drainQueue
:relfileprefix: ../../../
:mrdocs:

Wait until all jobs in the queue with the specified `id` finish&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
drainQueue(int id);
----

== Description

Wait until all jobs in the queue indicated by the specified `id` are finished&period; This method simply waits until that queue is empty, without disabling the queue&semi; it may thus wait indefinitely if more jobs are being added&period; The queue may be enabled or disabled when this method is called&period; Return 0 on success, and a non&hyphen;zero value if the specified queue does not exist or is deleted while this method is waiting&period; Note that this method waits by repeatedly yielding&period;

== Return Value

0 on success, and a non&hyphen;zero value if the queue does not exist or is deleted while waiting

== Parameters

[cols="1,4"]
|===
| Name| Description
| *id*
| queue identifier
|===


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