#include <BoundedThreadPool.hpp>
Definition at line 25 of file BoundedThreadPool.hpp.
 
◆ BoundedThreadPool() [1/3]
  
  
      
        
          | BoundedThreadPool::BoundedThreadPool  | 
          ( | 
          int  | 
          n_threads | ) | 
           | 
         
       
   | 
  
inlineexplicit   | 
  
 
 
◆ BoundedThreadPool() [2/3]
  
  
      
        
          | BoundedThreadPool::BoundedThreadPool  | 
          ( | 
          int  | 
          n_threads,  | 
         
        
           | 
           | 
          int  | 
          limit  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlineexplicit   | 
  
 
 
◆ BoundedThreadPool() [3/3]
  
  
      
        
          | BoundedThreadPool::BoundedThreadPool  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ ~BoundedThreadPool()
  
  
      
        
          | BoundedThreadPool::~BoundedThreadPool  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ init()
  
  
      
        
          | void BoundedThreadPool::init  | 
          ( | 
          int  | 
          n_threads,  | 
         
        
           | 
           | 
          int  | 
          limit  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
 
◆ join_threads()
  
  
      
        
          | void BoundedThreadPool::join_threads  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ push_task() [1/2]
template<typename T > 
  
  
      
        
          | void BoundedThreadPool::push_task  | 
          ( | 
          const T &  | 
          task | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Definition at line 77 of file BoundedThreadPool.hpp.
   79         std::unique_lock<std::mutex> lock(mtx_queue);
 
   80         cnd_buffer_full.wait(lock, [
this]
 
   81                              { 
return ((
int)tasks.size() < 
limit); });
 
   82         tasks.push(std::function<
void()>(task));
 
   83         cnd_buffer_empty.notify_one();
 
 
 
 
◆ push_task() [2/2]
template<typename T , typename... A> 
  
  
      
        
          | void BoundedThreadPool::push_task  | 
          ( | 
          const T &  | 
          task,  | 
         
        
           | 
           | 
          const A &...  | 
          args  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
 
◆ wait_for_completion()
  
  
      
        
          | void BoundedThreadPool::wait_for_completion  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Definition at line 93 of file BoundedThreadPool.hpp.
   95         std::unique_lock<std::mutex> lock(mtx_queue);
 
   96         cnd_buffer_full.wait(lock, [
this]
 
   97                              { 
return tasks.empty(); });
 
 
 
 
◆ limit
      
        
          | int BoundedThreadPool::limit | 
        
      
 
 
◆ n_threads
      
        
          | int BoundedThreadPool::n_threads | 
        
      
 
 
The documentation for this class was generated from the following file: