Resource Tuner
Loading...
Searching...
No Matches
ThreadPool Class Reference

ThreadPool. More...

#include <ThreadPool.h>

Public Member Functions

int8_t enqueueTask (std::function< void(void *)> callBack, void *arg)
 Enqueue a task for processing by one of ThreadPool's thread.
 

Private Attributes

int32_t mDesiredPoolCapacity
 Desired or Base Thread Pool Capacity.
 
int32_t mMaxPoolCapacity
 Max Capacity upto which the Thread Pool can scale up.
 

Detailed Description

ThreadPool.

Pre-Allocate thread (Workers) capacity for future use, so as to prevent repeated Thread creation / destruction costs.

Definition at line 87 of file ThreadPool.h.

Member Function Documentation

◆ enqueueTask()

int8_t ThreadPool::enqueueTask ( std::function< void(void *)>  callBack,
void *  arg 
)

Enqueue a task for processing by one of ThreadPool's thread.

Parameters
taskCallbackfunction pointer to the task.
argPointer to the task arguments.
Returns
int8_t:
  • 1 if the request was successfully enqueued,
  • 0 otherwise.

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