Enqueue functor for execution by a worker thread.
Synopsis
Declared in <bdlmt_fixedthreadpool.h>
int
enqueueJob(Job const& functor);
Description
Enqueue the specified functor to be executed by the next available thread. Return 0 on success, and a non‐zero value otherwise. Specifically, return e_SUCCESS on success, e_DISABLED if !isEnabled(), and e_FAILED if an error occurs. This operation will block if there is not sufficient capacity in the underlying queue until there is free capacity to successfully enqueue this job. Threads blocked (on enqueue methods) due to the underlying queue being full will unblock and return e_DISABLED if disable is invoked (on another thread). The behavior is undefined unless functor is not null.
Return Value
0 on success, and a non‐zero value otherwise
Parameters
Name |
Description |
functor |
job to be executed by a worker thread |
Created with MrDocs