diff --git a/src/libCom/osi/epicsAtomicGuard.h b/src/libCom/osi/epicsAtomicGuard.h index 7e5cf5334..b9cf2a74d 100644 --- a/src/libCom/osi/epicsAtomicGuard.h +++ b/src/libCom/osi/epicsAtomicGuard.h @@ -51,4 +51,5 @@ namespace { }; } // end of anonymous namespace -#endif // ifndef epicsAtomicGuard_h \ No newline at end of file +#endif // ifndef epicsAtomicGuard_h + diff --git a/src/libCom/osi/os/posix/epicsAtomicOSD.cpp b/src/libCom/osi/os/posix/epicsAtomicOSD.cpp index e6cf40d22..5e182d748 100644 --- a/src/libCom/osi/os/posix/epicsAtomicOSD.cpp +++ b/src/libCom/osi/os/posix/epicsAtomicOSD.cpp @@ -24,9 +24,12 @@ * than pthread_once. */ +#include #include +#include #define epicsExportSharedSymbols +#include "epicsAssert.h" #include "epicsAtomic.h" // If we have an inline implementation then implement @@ -39,11 +42,12 @@ namespace { // a statically initialized mutex doesnt need to be destroyed -static pthread_mutex_t AtomicGuard :: mutex = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; inline AtomicGuard :: AtomicGuard () throw () { unsigned countDown = 1000u; + int status; while ( true ) { status = pthread_mutex_lock ( & mutex ); if ( status != EINTR ) break; diff --git a/src/libCom/osi/os/vxWorks/epicsAtomicOSD.h b/src/libCom/osi/os/vxWorks/epicsAtomicOSD.h index b46c66436..b7a9e0f4b 100644 --- a/src/libCom/osi/os/vxWorks/epicsAtomicOSD.h +++ b/src/libCom/osi/os/vxWorks/epicsAtomicOSD.h @@ -20,6 +20,8 @@ #include "vxWorks.h" /* obtain the version of vxWorks */ #include "epicsAssert.h" +#define OSD_ATOMIC_INLINE_DEFINITION + /* * With vxWorks 6.6 and later we need to use vxAtomicLib * to implement this functionality correctly on SMP systems @@ -29,8 +31,6 @@ #include #include -#define OSD_ATOMIC_INLINE_DEFINITION - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */