Bitcoin ABC 0.26.3
P2P Digital Currency
|
Simple work queue for distributing work over multiple threads. More...
Public Member Functions | |
WorkQueue (size_t _maxDepth) | |
~WorkQueue () | |
Precondition: worker threads have all stopped (they have all been joined) | |
bool | Enqueue (WorkItem *item) EXCLUSIVE_LOCKS_REQUIRED(!cs) |
Enqueue a work item. | |
void | Run () EXCLUSIVE_LOCKS_REQUIRED(!cs) |
Thread function. | |
void | Interrupt () EXCLUSIVE_LOCKS_REQUIRED(!cs) |
Interrupt and exit loops. | |
Private Attributes | |
Mutex | cs |
Mutex protects entire object. | |
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.
Definition at line 73 of file httpserver.cpp.
Definition at line 83 of file httpserver.cpp.
Precondition: worker threads have all stopped (they have all been joined)
Definition at line 87 of file httpserver.cpp.
Enqueue a work item.
Definition at line 90 of file httpserver.cpp.
Interrupt and exit loops.
Definition at line 120 of file httpserver.cpp.
Thread function.
Definition at line 101 of file httpserver.cpp.
Definition at line 77 of file httpserver.cpp.
Mutex protects entire object.
Definition at line 76 of file httpserver.cpp.
Definition at line 80 of file httpserver.cpp.
Definition at line 78 of file httpserver.cpp.
Definition at line 79 of file httpserver.cpp.