Manages a pool of ACS Base threads.
More...
#include <acsThreadBase.h>
List of all members.
Detailed Description
Manages a pool of ACS Base threads.
- Todo:
- GCH Why a forward declaration for the Thread class here? Thread Base should be sufficient !!!!! Try to remove it and see what happens.
Constructor & Destructor Documentation
ACS::ThreadManagerBase::ThreadManagerBase |
( |
|
) |
[inline] |
- Todo:
- GCH Why a friend declaration for the Thread class here? Thread Base should be sufficient !!!!! Try to remove it and see what happens.
Constructor.
References threadManager_mp.
ACS::ThreadManagerBase::~ThreadManagerBase |
( |
|
) |
|
Destructor. Also terminates and deletes all threads.
ALMA C++ coding standards state copy constructors should be disabled.
Member Function Documentation
bool ACS::ThreadManagerBase::add |
( |
const ACE_CString & |
name, |
|
|
ThreadBase * |
acsBaseThread | |
|
) |
| | |
void ACS::ThreadManagerBase::add2map |
( |
const ACE_CString & |
name, |
|
|
ThreadBase * |
thread | |
|
) |
| | [inline, protected] |
bool ACS::ThreadManagerBase::areAllAlive |
( |
|
) |
|
Checks if all threads are alive (not terminated).
- Parameters:
-
- Returns:
- true if all threads are alive
- See also:
- ThreadManagerBase::isAlive
bool ACS::ThreadManagerBase::cancel |
( |
const ACE_CString & |
name |
) |
|
bool ACS::ThreadManagerBase::cancelAll |
( |
|
) |
|
ThreadBase* ACS::ThreadManagerBase::create |
( |
const ACE_CString & |
name, |
|
|
void * |
threadProc, |
|
|
void * |
parameter, |
|
|
const TimeInterval & |
responseTime = ThreadBase::defaultResponseTime , |
|
|
const TimeInterval & |
sleepTime = ThreadBase::defaultSleepTime , |
|
|
const long |
_thrFlags = THR_NEW_LWP|THR_DETACHED , |
|
|
const size_t |
_stackSize = ACE_DEFAULT_THREAD_STACKSIZE | |
|
) |
| | |
Create a new thread and add it to the pool. The thread is immediately created (create=true) and suspended
- Parameters:
-
| name | of the thread |
| threadProc | thread worker function |
| parameter | an optional parameter to the thread |
| responseTime | heartbeat response time in 100ns unit |
| sleepTime | default sleep time in 100ns unit |
| _thrFlags | Thread creation flags to be used if _create = TRUE. See ACE threads and pthread documentation for details. Default is now THR_NEW_LWP | THR_DETACHED |
- Returns:
- pointer to ThreadBase object, NULL otherwise
- See also:
- ThreadBase
void ACS::ThreadManagerBase::exit |
( |
const ACE_CString & |
name |
) |
|
Notify named thread to exit thread worker function.
- Parameters:
-
- See also:
- ThreadBase::exit
void ACS::ThreadManagerBase::exitAll |
( |
|
) |
|
ACE_Thread_Manager* ACS::ThreadManagerBase::getACEThreadManager |
( |
|
) |
[inline] |
Returns pointer to the ACE Thread Manager
- Returns:
- pointer to ACE_Thread_Manager object
References threadManager_mp.
ThreadBase* ACS::ThreadManagerBase::getThreadAt |
( |
const int |
pos |
) |
const [inline] |
Get thread at the specified position.
- Parameters:
-
| pos | position of the thread |
- Returns:
- pointer to ThreadBase object
References threads_m.
ThreadBase* ACS::ThreadManagerBase::getThreadByID |
( |
ACE_thread_t |
id |
) |
[inline] |
Get thread with specified ID.
- Parameters:
-
- Returns:
- pointer to ThreadBase object, NULL otherwise
References threads_m.
ThreadBase* ACS::ThreadManagerBase::getThreadByName |
( |
const ACE_CString & |
name |
) |
[inline] |
int ACS::ThreadManagerBase::getThreadCount |
( |
|
) |
const [inline] |
Get number of threads in the pool.
- Returns:
- number of threads in the pool
References threads_m.
ACE_CString ACS::ThreadManagerBase::getThreadName |
( |
const int |
pos |
) |
const [inline] |
Get name of the thread at the specified position.
- Parameters:
-
| pos | position of the thread |
- Returns:
- name of the thread
References threads_m.
bool ACS::ThreadManagerBase::isAlive |
( |
const ACE_CString & |
name |
) |
|
Checks if named thread is alive (not terminated).
- Parameters:
-
- Returns:
- true if named thread is alive
- See also:
- ThreadBase::isAlive
int ACS::ThreadManagerBase::join |
( |
const ACE_thread_t & |
tid |
) |
|
join joinable thread
- Parameters:
-
- Returns:
- -1 if fail
int ACS::ThreadManagerBase::join |
( |
const ThreadBase * |
th |
) |
|
join joinable thread
- Parameters:
-
- Returns:
- -1 if fail
ALMA C++ coding standards state assignment operators should be disabled.
void ACS::ThreadManagerBase::removeFromMap |
( |
const ACE_CString & |
name |
) |
[inline, protected] |
bool ACS::ThreadManagerBase::restart |
( |
const ACE_CString & |
name |
) |
|
Restart named thread. Restarting means treminate and recreate a new thread.
- Parameters:
-
- See also:
- ThreadBase::restart
bool ACS::ThreadManagerBase::restartAll |
( |
|
) |
|
bool ACS::ThreadManagerBase::restartDead |
( |
|
) |
|
bool ACS::ThreadManagerBase::resume |
( |
const ACE_CString & |
name |
) |
|
Continue the execution of a previously suspended thread.
- Parameters:
-
- See also:
- ThreadBase::resume
bool ACS::ThreadManagerBase::resumeAll |
( |
|
) |
|
bool ACS::ThreadManagerBase::stop |
( |
const ACE_CString & |
name |
) |
|
Stop named thread.
- Parameters:
-
- Returns:
- true if thread has been stopped
- See also:
- ThreadBase::stop
bool ACS::ThreadManagerBase::stopAll |
( |
|
) |
|
bool ACS::ThreadManagerBase::suspend |
( |
const ACE_CString & |
name |
) |
|
bool ACS::ThreadManagerBase::suspendAll |
( |
|
) |
|
bool ACS::ThreadManagerBase::terminate |
( |
const ACE_CString & |
name |
) |
|
bool ACS::ThreadManagerBase::terminateAll |
( |
|
) |
|
Member Data Documentation
The documentation for this class was generated from the following file: