add start method to osiThread
This commit is contained in:
@@ -18,10 +18,11 @@
|
||||
#include <iocinf.h>
|
||||
|
||||
processThread::processThread (cac *pcacIn) :
|
||||
osiThread ("CAC process", 0x1000, threadPriorityMedium),
|
||||
osiThread (),
|
||||
pcac (pcacIn),
|
||||
shutDown (false)
|
||||
{
|
||||
start("CAC process", 0x1000, threadPriorityMedium);
|
||||
}
|
||||
|
||||
processThread::~processThread ()
|
||||
|
||||
@@ -19,16 +19,22 @@ static void osiThreadCallEntryPoint (void *pPvt)
|
||||
pThread->exit.signal ();
|
||||
}
|
||||
|
||||
osiThread::osiThread (const char *name, unsigned stackSize,
|
||||
unsigned priority)
|
||||
|
||||
osiThread::osiThread () : id(0), exit()
|
||||
{
|
||||
this->id = threadCreate (name, priority, stackSize,
|
||||
osiThreadCallEntryPoint, static_cast <void *> (this) );
|
||||
}
|
||||
|
||||
osiThread::~osiThread ()
|
||||
{
|
||||
while ( !this->exit.wait (5.0) ) {
|
||||
printf ("osiThread::~osiThread (): Warning, thread object destroyed before thread exit \n");
|
||||
printf ("osiThread::~osiThread ():"
|
||||
" Warning, thread object destroyed before thread exit \n");
|
||||
}
|
||||
}
|
||||
|
||||
void osiThread::start(const char *name, unsigned stackSize, unsigned priority)
|
||||
{
|
||||
id = threadCreate (name, priority, stackSize,
|
||||
osiThreadCallEntryPoint, static_cast <void *> (this) );
|
||||
}
|
||||
|
||||
|
||||
@@ -99,10 +99,12 @@ epicsShareFunc void * epicsShareAPI threadPrivateGet (threadPrivateId);
|
||||
|
||||
class epicsShareClass osiThread {
|
||||
public:
|
||||
osiThread (const char *name, unsigned stackSize,
|
||||
unsigned priority=threadPriorityLow);
|
||||
osiThread();
|
||||
virtual ~osiThread ();
|
||||
|
||||
void start(const char *name, unsigned stackSize,
|
||||
unsigned priority=threadPriorityLow);
|
||||
|
||||
virtual void entryPoint () = 0;
|
||||
|
||||
void resume ();
|
||||
|
||||
@@ -438,9 +438,9 @@ osiTimerQueue::~osiTimerQueue()
|
||||
// osiTimerThread::osiTimerThread ()
|
||||
//
|
||||
osiTimerThread::osiTimerThread (osiTimerQueue &queueIn, unsigned priority) :
|
||||
osiThread ("osiTimerQueue", threadGetStackSize (threadStackMedium), priority),
|
||||
queue (queueIn)
|
||||
osiThread (), queue (queueIn)
|
||||
{
|
||||
start("osiTimerQueue", threadGetStackSize (threadStackMedium), priority);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user