BloombergLP::bdlmt::MultipriorityThreadPool::enqueueJob

Enqueue the specified job at the specified priority.

Synopsis

Declared in <bdlmt_multiprioritythreadpool.h>

int
enqueueJob(
    ThreadFunctor const& job,
    int priority);

Description

Add the specified job to the queue of this multi-priority thread pool, assigning it the specified priority. Return 0 if the job was enqueued successfully, and a non-zero value otherwise (implying that the queue was in the disabled state). The behavior is undefined unless 0 <= priority < numPriorities().

Return Value

0 if the job was enqueued, and a non-zero value otherwise

Parameters

NameDescription
jobfunctor to be executed by a worker thread
priorityjob priority; 0 is most urgent