|
Monero
|
A global thread pool. More...
#include <threadpool.h>
Classes | |
| class | waiter |
| struct | entry |
Public Member Functions | |
| void | submit (waiter *waiter, std::function< void()> f, bool leaf=false) |
| void | recycle () |
| unsigned int | get_max_concurrency () const |
| ~threadpool () | |
Static Public Member Functions | |
| static threadpool & | getInstanceForCompute () |
| static threadpool & | getInstanceForIO () |
| static threadpool * | getNewForUnitTests (unsigned max_threads=0) |
Private Types | |
| typedef struct tools::threadpool::entry | entry |
Private Member Functions | |
| threadpool (unsigned int max_threads=0) | |
| void | destroy () |
| void | create (unsigned int max_threads) |
| void | run (bool flush=false) |
Private Attributes | |
| std::deque< entry > | queue |
| boost::condition_variable | has_work |
| boost::mutex | mutex |
| std::vector< boost::thread > | threads |
| unsigned int | active |
| unsigned int | max |
| bool | running |
A global thread pool.
|
private |
| tools::threadpool::~threadpool | ( | ) |
|
private |
|
private |
|
private |
| unsigned int tools::threadpool::get_max_concurrency | ( | ) | const |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
| void tools::threadpool::recycle | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |