add start method to osiThread

This commit is contained in:
Marty Kraimer
2000-05-19 15:40:15 +00:00
parent e4d9ceb26c
commit 8230a0622d
4 changed files with 19 additions and 10 deletions
+2 -1
View File
@@ -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 ()
+11 -5
View File
@@ -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) );
}
+4 -2
View File
@@ -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 ();
+2 -2
View File
@@ -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);
}
//