[#BloombergLP-bdlmt-MultiQueueThreadPool_Queue-enqueueDeletion]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/MultiQueueThreadPool_Queue.adoc[MultiQueueThreadPool&lowbar;Queue]::enqueueDeletion
:relfileprefix: ../../../
:mrdocs:

Disable this queue and schedule its deletion&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
enqueueDeletion(
    xref:BloombergLP/bdlmt/MultiQueueThreadPool_Queue/Job.adoc[Job] const& cleanupFunctor = Job(),
    xref:BloombergLP/bslmt/Latch.adoc[bslmt::Latch]* completionSignal = 0);
----

== Description

Permanently disable enqueueing from this queue, and enqueue a job that will delete this queue&period; Optionally specify `cleanupFunctor`, which, if supplied, will be invoked immediately prior to this queue&apos;s deletion&period; Optionally specify `completionSignal`, on which (if the calling thread is not processing a job &hyphen; or batch of jobs &hyphen; for this queue) to invoke `arrive` when the queue is deleted&period; Return `true` if the current thread is the thread processing a job (or batch of jobs), and `false` otherwise&period; Note that if `completionSignal` is supplied, a return status of `false` typically indicates that `completionSignal&hyphen;&gt;wait()` should be invoked from the calling function&apos;, while a return status of `true` indicates this is an attempt to delete the queue from within a job being processed on the queue (so waiting on the queue&apos;s deletion would result in a dead&hyphen;lock)&period;

== Return Value

`true` if the current thread is processing a job for this queue, and `false` otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cleanupFunctor*
| optional functor invoked before queue deletion
| *completionSignal*
| optional latch signaled when the queue is deleted
|===


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