Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::ThreadPool Class Reference

Public Member Functions

 ThreadPool (size_t threads, std::function< void()> onThreadStart=[]() {}, std::function< void()> onThreadStop=[]() {})
 
template<class F , class... Args>
auto enqueue (F &&f, Args &&... args) -> std::future< std::invoke_result_t< F, Args... > >
 
void enqueueRaw (std::function< void()> f)
 
size_t trySetSize (size_t size)
 
size_t getSize () const
 
size_t getQueueSize ()
 

Member Function Documentation

◆ enqueue()

template<class F , class... Args>
auto inviwo::ThreadPool::enqueue ( F && f,
Args &&... args ) -> std::future<std::invoke_result_t<F, Args...>>

Enqueue function f with arguments args. The function f may throw exceptions.

Returns
a future to the result of f

◆ enqueueRaw()

void inviwo::ThreadPool::enqueueRaw ( std::function< void()> f)

Enqueue a plain functor. The functor may not throw exceptions.


The documentation for this class was generated from the following file: