API Documentation
ThreadPool.h
1 // ThreadPool.h
3 //
5 
6 namespace nkTasks
7 {
11  class ThreadPool final
12  {
13  public :
14 
15  // Constructor, destructor
21  ThreadPool (unsigned int threadCount = 0) noexcept ;
28  ~ThreadPool () ;
29 
30  // Getters
34  unsigned int getThreadCount () const ;
39  Thread* getThread (unsigned int index) const ;
40 
41  // Tasks
50  void addTask (nkMemory::UniquePtr<Task> task) ;
55 
56  // Threads
60  void flush () ;
66  void resizeForThreadCount (unsigned int threadCount) ;
67  } ;
68 }
nkTasks::Thread
Symbolizes a thread. Base block to submit off-thread nkTasks::Task in this component.
Definition: Thread.h:12
nkTasks::ThreadPool::cancelPendingTasks
void cancelPendingTasks()
nkTasks::Task
A task, job that can be submitted to a nkTasks::Thread.
Definition: Task.h:14
nkTasks::ThreadPool
A pool with pre-created threads, allowing to queue work asynchronously.
Definition: ThreadPool.h:12
nkTasks
Encompasses all API of component NilkinsTasks.
Definition: LogManager.h:7
nkTasks::ThreadPool::getThread
Thread * getThread(unsigned int index) const
nkTasks::ThreadPool::getThreadCount
unsigned int getThreadCount() const
nkTasks::ThreadPool::addTask
void addTask(nkMemory::UniquePtr< Task > task)
nkTasks::ThreadPool::resizeForThreadCount
void resizeForThreadCount(unsigned int threadCount)
nkTasks::ThreadPool::ThreadPool
ThreadPool(unsigned int threadCount=0) noexcept
nkTasks::ThreadPool::flush
void flush()
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7