fixed gnu warnings

This commit is contained in:
Jeff Hill
2000-03-13 15:35:11 +00:00
parent 06f49001ff
commit d02b8a526d
2 changed files with 18 additions and 1 deletions

View File

@@ -4,7 +4,9 @@
// Author: Jeff Hill
//
#include <stdio.h>
#include <stddef.h>
#define epicsExportSharedSymbols
#include "osiThread.h"
@@ -12,6 +14,7 @@ static void osiThreadCallEntryPoint (void *pPvt)
{
osiThread *pThread = static_cast<osiThread *> (pPvt);
pThread->entryPoint ();
pThread->exit.signal ();
}
osiThread::osiThread (const char *name, unsigned stackSize,
@@ -20,3 +23,10 @@ osiThread::osiThread (const char *name, unsigned stackSize,
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");
}
}

View File

@@ -88,11 +88,15 @@ epicsShareFunc void * epicsShareAPI threadPrivateGet (threadPrivateId);
#ifdef __cplusplus
#include "locationException.h"
#include "osiEvent.h"
class osiThread {
static void osiThreadCallEntryPoint (void *pPvt); // for gnu warning
class epicsShareClass osiThread {
public:
osiThread (const char *name, unsigned stackSize,
unsigned priority=threadPriorityLow);
virtual ~osiThread ();
virtual void entryPoint () = 0;
@@ -112,6 +116,9 @@ public:
static const char * getNameSelf ();
private:
threadId id;
osiEvent exit;
friend void osiThreadCallEntryPoint (void *pPvt);
};
template <class T>