Bitcoin
|
Public Member Functions | |
WorkQueue (size_t _maxDepth) | |
~WorkQueue () | |
bool | Enqueue (WorkItem *item) |
void | Run () |
void | Interrupt () |
Private Attributes | |
Mutex | cs |
std::condition_variable | cond |
std::deque< std::unique_ptr< WorkItem > > | queue |
bool | running |
size_t | maxDepth |
Simple work queue for distributing work over multiple threads. Work items are simply callable objects.
Precondition: worker threads have all stopped (they have been joined).
|
inline |
Enqueue a work item
|
inline |
Interrupt and exit loops
|
inline |
Thread function
|
private |
|
private |
|
private |
|
private |