![]() |
LIMA
Libre Multilingual Analyzer — C++ API
|
#include <deeplima/utils/thread_pool.h>
Public Member Functions | |
| ThreadPool (size_t num_threads=0) | |
| void | init (size_t num_threads) |
| size_t | get_num_threads () const |
| virtual | ~ThreadPool () |
| void | stop () |
| size_t | running () |
| void | push (void *job) |
Protected Member Functions | |
| bool | wait_for_new_job (void **job) |
| This will wait until a job is available and then job parameter will be set to this available which will be removed from the list. | |
| void | wait_for_any_job_notification (const std::function< bool()> fn) |
| void | thread_fn (size_t worker_id) |
Protected Attributes | |
| std::vector< std::thread > | m_workers |
| std::atomic< bool > | m_stop |
| std::queue< void * > | m_jobs |
| std::mutex | m_mutex |
| std::condition_variable | m_cv |
| std::mutex | m_mutex_notify |
| std::condition_variable | m_cv_notify |
Definition at line 22 of file thread_pool.h.
|
inline |
Definition at line 26 of file thread_pool.h.
|
inlinevirtual |
Definition at line 52 of file thread_pool.h.
|
inline |
Definition at line 47 of file thread_pool.h.
|
inline |
Definition at line 35 of file thread_pool.h.
|
inline |
Definition at line 94 of file thread_pool.h.
|
inline |
Definition at line 89 of file thread_pool.h.
|
inline |
Definition at line 59 of file thread_pool.h.
|
inlineprotected |
Definition at line 128 of file thread_pool.h.
|
inlineprotected |
Definition at line 122 of file thread_pool.h.
|
inlineprotected |
This will wait until a job is available and then job parameter will be set to this available which will be removed from the list.
Definition at line 106 of file thread_pool.h.
|
protected |
Definition at line 169 of file thread_pool.h.
|
protected |
Definition at line 172 of file thread_pool.h.
|
protected |
Definition at line 167 of file thread_pool.h.
|
protected |
Definition at line 168 of file thread_pool.h.
|
protected |
Definition at line 171 of file thread_pool.h.
|
protected |
Definition at line 165 of file thread_pool.h.
|
protected |
Definition at line 164 of file thread_pool.h.