![]() |
Bitcoin Core 22.99.0
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 been joined). More... | |
| bool | Enqueue (WorkItem *item) |
| Enqueue a work item. More... | |
| void | Run () |
| Thread function. More... | |
| void | Interrupt () |
| Interrupt and exit loops. More... | |
Private Member Functions | |
| std::condition_variable cond | GUARDED_BY (cs) |
| std::deque< std::unique_ptr< WorkItem > > queue | GUARDED_BY (cs) |
| bool running | GUARDED_BY (cs) |
Private Attributes | |
| Mutex | cs |
| const size_t | maxDepth |
Simple work queue for distributing work over multiple threads.
Work items are simply callable objects.
Definition at line 64 of file httpserver.cpp.
Definition at line 74 of file httpserver.cpp.
Precondition: worker threads have all stopped (they have been joined).
Definition at line 80 of file httpserver.cpp.
|
inline |
Enqueue a work item.
Definition at line 84 of file httpserver.cpp.
|
private |
|
private |
|
inline |
Interrupt and exit loops.
Definition at line 112 of file httpserver.cpp.
|
inline |
Thread function.
Definition at line 95 of file httpserver.cpp.
Definition at line 67 of file httpserver.cpp.
|
private |
Definition at line 71 of file httpserver.cpp.