fixed gnu warnings
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user