![]() |
BSHA3
0.17.99
P2P Blockchain, based on Bitcoin
|
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 Attributes | |
| Mutex | cs |
| Mutex protects entire object. More... | |
| 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 68 of file httpserver.cpp.
Definition at line 79 of file httpserver.cpp.
Precondition: worker threads have all stopped (they have been joined).
Definition at line 85 of file httpserver.cpp.
|
inline |
Enqueue a work item.
Definition at line 89 of file httpserver.cpp.
|
inline |
Interrupt and exit loops.
Definition at line 117 of file httpserver.cpp.
|
inline |
Thread function.
Definition at line 100 of file httpserver.cpp.
|
private |
Definition at line 73 of file httpserver.cpp.
Mutex protects entire object.
Definition at line 72 of file httpserver.cpp.
|
private |
Definition at line 76 of file httpserver.cpp.
|
private |
Definition at line 74 of file httpserver.cpp.
|
private |
Definition at line 75 of file httpserver.cpp.
1.8.14