#include <acsThreadTest.h>
Inheritance diagram for TestACSThread:
Public Member Functions | |
TestACSThread (const ACE_CString &name, const ACS::TimeInterval &responseTime=ThreadBase::defaultResponseTime, const ACS::TimeInterval &sleepTime=ThreadBase::defaultSleepTime, bool del=false) | |
TestACSThread (const ACE_CString &name, const ACS::TimeInterval &responseTime, const ACS::TimeInterval &sleepTime, bool del, const long _thrFlags) | |
~TestACSThread () | |
virtual void | runLoop () |
Protected Attributes | |
int | loopCounter_m |
|
|
|
|
|
Destructor. Notice that here we have to call terminate() to protect the thread from concurrency problems. The runLoop() method uses data members of the thread (loopCounter). When the thread object get deleted, we have to be sure the thread is stopped before we delete the member variables, and therefore we have to call terminate() here. The fact that terminate is called in the destructor of ACS::ThreadBase does not help, because it can happen the runLoop() method is called between this destructor and the ones of the parent classes. This would cause access to already unallocated memory. |
|
This is the method executed in the thread loop. It executes 10 times, then it exits. Reimplemented from ACS::Thread.
|
|
|