threadOnce fix (fixes use of macro)
This commit is contained in:
@@ -184,8 +184,9 @@ void threadOnceOsd(threadOnceId *id, void (*func)(void *), void *arg)
|
||||
|
||||
semMutexMustTake(onceMutex);
|
||||
if (*id == 0) {
|
||||
*id = 1;
|
||||
*id = -1;
|
||||
func(arg);
|
||||
*id = 1;
|
||||
}
|
||||
semMutexGive(onceMutex);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ epicsShareFunc void epicsShareAPI threadOnceOsd(
|
||||
#define threadOnce(id,func,arg) \
|
||||
do { \
|
||||
threadOnceId *idCopy =(id); \
|
||||
if(*idCopy == 0) \
|
||||
if(*idCopy <= 0) \
|
||||
threadOnceOsd(idCopy,func,arg); \
|
||||
} while(0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user