#include <ThreadPool.hpp>
◆ ThreadPool()
ThreadPool::ThreadPool |
( |
size_t |
threads | ) |
|
|
inline |
◆ ~ThreadPool()
ThreadPool::~ThreadPool |
( |
| ) |
|
|
inline |
◆ enqueue()
template<class F , class... Args>
auto ThreadPool::enqueue |
( |
F && |
f, |
|
|
Args &&... |
args |
|
) |
| -> std::future<typename std::invoke_result<F,Args...>::type> |
◆ get()
References instance().
Referenced by grk::CodeStream::compress(), grk::T1CompressScheduler::compress(), grk::mct::compress_irrev(), grk::mct::compress_rev(), grk::T1DecompressScheduler::decompress(), grk::mct::decompress_dc_shift_irrev(), grk::mct::decompress_dc_shift_rev(), grk::decompress_h_mt_53(), grk::decompress_h_mt_97(), grk::mct::decompress_irrev(), grk::decompress_partial_tile(), grk::mct::decompress_rev(), grk::decompress_tile_53(), grk::decompress_tile_97(), grk::CodeStream::decompress_tiles(), grk::decompress_v_mt_53(), grk::decompress_v_mt_97(), grk::WaveletForward< DWT >::run(), grk::T1CompressScheduler::scheduleCompress(), and grk::T1DecompressScheduler::scheduleDecompress().
◆ hardware_concurrency()
static uint32_t ThreadPool::hardware_concurrency |
( |
| ) |
|
|
inlinestatic |
◆ instance()
static ThreadPool* ThreadPool::instance |
( |
uint32_t |
numthreads | ) |
|
|
inlinestatic |
◆ num_threads()
size_t ThreadPool::num_threads |
( |
| ) |
|
|
inline |
References m_num_threads.
Referenced by grk::T1CompressScheduler::compress(), grk::mct::compress_irrev(), grk::mct::compress_rev(), grk::T1DecompressScheduler::decompress(), grk::mct::decompress_dc_shift_irrev(), grk::mct::decompress_dc_shift_rev(), grk::mct::decompress_irrev(), grk::decompress_partial_tile(), grk::mct::decompress_rev(), grk::decompress_tile_53(), grk::decompress_tile_97(), grk::CodeStream::decompress_tiles(), grk::WaveletForward< DWT >::run(), grk::T1CompressScheduler::scheduleCompress(), and grk::T1DecompressScheduler::scheduleDecompress().
◆ release()
static void ThreadPool::release |
( |
| ) |
|
|
inlinestatic |
◆ thread_number()
int ThreadPool::thread_number |
( |
std::thread::id |
id | ) |
|
|
inline |
◆ condition
std::condition_variable ThreadPool::condition |
|
private |
◆ id_map
std::map<std::thread::id, size_t> ThreadPool::id_map |
|
private |
◆ m_num_threads
size_t ThreadPool::m_num_threads |
|
private |
◆ queue_mutex
std::mutex ThreadPool::queue_mutex |
|
private |
◆ singleton
◆ singleton_mutex
std::mutex ThreadPool::singleton_mutex |
|
staticprivate |
◆ stop
◆ tasks
std::queue< std::function<void()> > ThreadPool::tasks |
|
private |
◆ workers
std::vector< std::thread > ThreadPool::workers |
|
private |
The documentation for this class was generated from the following files: