Maintains a pool of threads.
More...
#include <ThreadPool.hh>
|
static TaskThread * | Acquire () |
| Acquire a thread.
|
|
static TaskThread * | Acquire () |
| Acquire a thread.
|
|
static bool | Active (TaskThread *Resource) |
| Check if a Thread is currently active.
|
|
static bool | Active (TaskThread *Resource) |
| Check if a Thread is currently active.
|
|
static void | ForEach (UnaryFunction &Func) |
| Iterate over the active threads.
|
|
static void | ForEach (UnaryFunction &Func) |
| Iterate over the active threads.
|
|
static void | Relinquish (TaskThread *Resource) |
| Return a thread to the pool.
|
|
static void | Relinquish (TaskThread *Resource) |
| Return a thread to the pool.
|
|
static void | Reset () |
| Release all resources from the thread pool.
|
|
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.
◆ Acquire() [1/2]
TaskThread * LDASTools::AL::ThreadPool::Acquire |
( |
| ) |
|
|
static |
Acquire a thread.
- Returns
- A resouce from the pool.
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.
◆ Acquire() [2/2]
static TaskThread * LDASTools::AL::ThreadPool::Acquire |
( |
| ) |
|
|
static |
Acquire a thread.
- Returns
- A resouce from the pool.
◆ Active() [1/2]
bool LDASTools::AL::ThreadPool::Active |
( |
TaskThread * | Resource | ) |
|
|
static |
Check if a Thread is currently active.
Check for Resource.
- Parameters
-
[in] | Resource | Check a resouce if in the pool. |
◆ Active() [2/2]
static bool LDASTools::AL::ThreadPool::Active |
( |
TaskThread * | Resource | ) |
|
|
static |
Check if a Thread is currently active.
- Parameters
-
[in] | Resource | Check a resouce if in the pool. |
◆ ForEach() [1/2]
void LDASTools::AL::ThreadPool::ForEach |
( |
UnaryFunction & | Func | ) |
|
|
static |
Iterate over the active threads.
Loop over each active thread in a thread safe manor.
- Parameters
-
[in] | Func | Function to execute. |
◆ ForEach() [2/2]
static void LDASTools::AL::ThreadPool::ForEach |
( |
UnaryFunction & | Func | ) |
|
|
static |
Iterate over the active threads.
- Parameters
-
[in] | Func | Function to execute. |
◆ Relinquish() [1/2]
void LDASTools::AL::ThreadPool::Relinquish |
( |
TaskThread * | Resource | ) |
|
|
static |
Return a thread to the pool.
Recyle the resource.
- Parameters
-
[in] | Resource | Return a resouce to the pool. |
◆ Relinquish() [2/2]
static void LDASTools::AL::ThreadPool::Relinquish |
( |
TaskThread * | Resource | ) |
|
|
static |
Return a thread to the pool.
- Parameters
-
[in] | Resource | Return a resouce to the pool. |
◆ Reset()
void LDASTools::AL::ThreadPool::Reset |
( |
| ) |
|
|
static |
Release all resources from the thread pool.
- Note
- This method should not be called by others. It is provided to help facilitate cleanup at program exit.
Get rid of threads currently doing something interesting
Get rid of threads waiting to do something interesting
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/ldas-tools-al-2.6.7/build/include/ldastoolsal/ThreadPool.hh
- /home/abuild/rpmbuild/BUILD/ldas-tools-al-2.6.7/src/ThreadPool.hh
- /home/abuild/rpmbuild/BUILD/ldas-tools-al-2.6.7/src/ThreadPool.cc