From cd630a1424d9696945877b31d397adb001cb692c Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Fri, 3 Mar 2000 16:33:00 +0000 Subject: [PATCH] change defs for threadOnceOsd; remove threadIsReady --- src/libCom/osi/osiThread.h | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/libCom/osi/osiThread.h b/src/libCom/osi/osiThread.h index 2cd7a5c37..c2830977e 100644 --- a/src/libCom/osi/osiThread.h +++ b/src/libCom/osi/osiThread.h @@ -33,20 +33,17 @@ typedef enum { epicsShareFunc unsigned int epicsShareAPI threadGetStackSize(threadStackSizeClass size); -/* threadOnce is a macro for efficiency (calls threadOnceOsd) */ typedef int threadOnceId; - #define OSITHREAD_ONCE_INIT 0 +/* void threadOnce(threadOnceId *id, void (*func)(void *), void *arg); */ +/* threadOnce is implemented as a macro */ +/*threadOnceOsd should not be called by user code*/ epicsShareFunc void epicsShareAPI threadOnceOsd( threadOnceId *id, void (*func)(void *), void *arg); #define threadOnce(id,func,arg) \ - do { \ - threadOnceId *idCopy =(id); \ - if(*idCopy <= 0) \ - threadOnceOsd(idCopy,func,arg); \ - } while(0) +if(*(id)==0) threadOnceOsd((id),(func),(arg)) typedef void *threadId; epicsShareFunc threadId epicsShareAPI threadCreate(const char *name, @@ -58,7 +55,6 @@ epicsShareFunc unsigned int epicsShareAPI threadGetPriority(threadId id); epicsShareFunc void epicsShareAPI threadSetPriority( threadId id,unsigned int priority); epicsShareFunc int epicsShareAPI threadIsEqual(threadId id1, threadId id2); -epicsShareFunc int epicsShareAPI threadIsReady(threadId id); epicsShareFunc int epicsShareAPI threadIsSuspended(threadId id); epicsShareFunc void epicsShareAPI threadSleep(double seconds); epicsShareFunc threadId epicsShareAPI threadGetIdSelf(void); @@ -99,7 +95,6 @@ public: unsigned getPriority () const; void setPriority (unsigned); bool priorityIsEqual (const osiThread &otherThread) const; - bool isReady () const; bool isSuspended () const; bool operator == (const osiThread &rhs) const; @@ -163,16 +158,6 @@ inline bool osiThread::priorityIsEqual (const osiThread &otherThread) const } } -inline bool osiThread::isReady () const -{ - if ( threadIsReady (this->id) ) { - return true; - } - else { - return false; - } -} - inline bool osiThread::isSuspended () const { if ( threadIsSuspended (this->id) ) {