ldas-tools-al
2.6.4
|
Maintains a pool of threads. More...
#include <ThreadPool.hh>
Classes | |
class | UnaryFunction |
Base for unary functions to be used in ForEach call. More... | |
Static Public Member Functions | |
static TaskThread * | Acquire () |
Acquire a thread. More... | |
static bool | Active (TaskThread *Resource) |
Check if a Thread is currently active. More... | |
static void | ForEach (UnaryFunction &Func) |
Iterate over the active threads. More... | |
static void | Relinquish (TaskThread *Resource) |
Return a thread to the pool. More... | |
static void | Reset () |
Release all resources from the thread pool. More... | |
static TaskThread * | Acquire () |
Acquire a thread. More... | |
static bool | Active (TaskThread *Resource) |
Check if a Thread is currently active. More... | |
static void | ForEach (UnaryFunction &Func) |
Iterate over the active threads. More... | |
static void | Relinquish (TaskThread *Resource) |
Return a thread to the pool. More... | |
static void | Reset () |
Release all resources from the thread pool. | |
Maintains a pool of threads.
This is a singleton class that maintains a list of threads that can be reused to perform asyncronous tasks.
|
static |
Acquire a thread.
Secure a resource from the pool of resouces. If there is no resouce available at the time of the call, a new resouce is allocated and returned to the caller.
|
static |
Acquire a thread.
|
static |
Check if a Thread is currently active.
Check for Resource.
[in] | Resource | Check a resouce if in the pool. |
|
static |
Check if a Thread is currently active.
[in] | Resource | Check a resouce if in the pool. |
|
static |
Iterate over the active threads.
[in] | Func | Function to execute. |
|
static |
Iterate over the active threads.
Loop over each active thread in a thread safe manor.
[in] | Func | Function to execute. |
|
static |
Return a thread to the pool.
[in] | Resource | Return a resouce to the pool. |
|
static |
Return a thread to the pool.
Recyle the resource.
[in] | Resource | Return a resouce to the pool. |
|
static |
Release all resources from the thread pool.
Get rid of threads currently doing something interesting
Get rid of threads waiting to do something interesting