From f9135c39cde942ba55ad96901bcc0ed56021e2e9 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Mon, 29 Oct 2012 20:20:36 +0100 Subject: [PATCH 1/6] configure: change Posix definition from 199506L to 200112L needed to be able to use spinlocks --- configure/os/CONFIG.Common.linuxCommon | 2 +- configure/os/CONFIG.Common.solaris-sparc | 2 +- configure/os/CONFIG.Common.solaris-x86 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure/os/CONFIG.Common.linuxCommon b/configure/os/CONFIG.Common.linuxCommon index 4f91583d7..a230d1734 100644 --- a/configure/os/CONFIG.Common.linuxCommon +++ b/configure/os/CONFIG.Common.linuxCommon @@ -14,7 +14,7 @@ OS_CLASS = Linux CODE_CPPFLAGS = -D_REENTRANT -POSIX_CPPFLAGS = -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500 +POSIX_CPPFLAGS = -D_POSIX_C_SOURCE=200112L -D_POSIX_THREADS -D_XOPEN_SOURCE=500 POSIX_LDLIBS = -lpthread # -D_BSD_SOURCE for gethostname() in unistd.h as needed by cacChannelIO.cpp. diff --git a/configure/os/CONFIG.Common.solaris-sparc b/configure/os/CONFIG.Common.solaris-sparc index d47a5165e..7e8788048 100644 --- a/configure/os/CONFIG.Common.solaris-sparc +++ b/configure/os/CONFIG.Common.solaris-sparc @@ -20,7 +20,7 @@ COMPILER_LDFLAGS += -mt SOLARIS_VERSION = $(subst 5.,,$(shell uname -r)) -POSIX_CPPFLAGS += -D_POSIX_C_SOURCE=199506L $(POSIX_CPPFLAGS_$(SOLARIS_VERSION)) +POSIX_CPPFLAGS += -D_POSIX_C_SOURCE=200112L $(POSIX_CPPFLAGS_$(SOLARIS_VERSION)) POSIX_CPPFLAGS += -D_XOPEN_SOURCE=500 POSIX_LDLIBS += -lposix4 -lpthread $(POSIX_LDLIBS_$(SOLARIS_VERSION)) diff --git a/configure/os/CONFIG.Common.solaris-x86 b/configure/os/CONFIG.Common.solaris-x86 index d19083422..e3632a7bc 100644 --- a/configure/os/CONFIG.Common.solaris-x86 +++ b/configure/os/CONFIG.Common.solaris-x86 @@ -20,7 +20,7 @@ COMPILER_LDFLAGS += -mt SOLARIS_VERSION = $(subst 5.,,$(shell uname -r)) -POSIX_CPPFLAGS += -D_POSIX_C_SOURCE=199506L $(POSIX_CPPFLAGS_$(SOLARIS_VERSION)) +POSIX_CPPFLAGS += -D_POSIX_C_SOURCE=200112L $(POSIX_CPPFLAGS_$(SOLARIS_VERSION)) POSIX_CPPFLAGS += -D_XOPEN_SOURCE=500 POSIX_LDLIBS += -lposix4 -lpthread $(POSIX_LDLIBS_$(SOLARIS_VERSION)) From a977edfaa6b690b593aae26e9a5f6773aa3c2f9f Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Mon, 29 Oct 2012 20:25:23 +0100 Subject: [PATCH 2/6] libCom/osi: add epicsSpin with default, posix, and vxWorks implementations - posix uses pthread_spin_ interface when supported, pthread_mutex_ otherwise - default uses epicsMutex - vxWorks (single core) uses intLock() --- src/libCom/osi/Makefile | 2 + src/libCom/osi/epicsSpin.h | 31 ++++++ src/libCom/osi/os/default/osdSpin.c | 71 +++++++++++++ src/libCom/osi/os/posix/osdSpin.c | 154 ++++++++++++++++++++++++++++ src/libCom/osi/os/vxWorks/osdSpin.c | 52 ++++++++++ 5 files changed, 310 insertions(+) create mode 100644 src/libCom/osi/epicsSpin.h create mode 100644 src/libCom/osi/os/default/osdSpin.c create mode 100644 src/libCom/osi/os/posix/osdSpin.c create mode 100644 src/libCom/osi/os/vxWorks/osdSpin.c diff --git a/src/libCom/osi/Makefile b/src/libCom/osi/Makefile index e22091712..94fe92c61 100644 --- a/src/libCom/osi/Makefile +++ b/src/libCom/osi/Makefile @@ -20,6 +20,7 @@ INC += osdInterrupt.h INC += epicsMutex.h INC += osdMutex.h +INC += epicsSpin.h INC += epicsEvent.h INC += osdEvent.h INC += epicsMath.h @@ -107,6 +108,7 @@ Com_SRCS += osdThread.c Com_SRCS += osdThreadExtra.c Com_SRCS += osdThreadHooks.c Com_SRCS += osdMutex.c +Com_SRCS += osdSpin.c Com_SRCS += osdEvent.c Com_SRCS += osdTime.cpp Com_SRCS += osdProcess.c diff --git a/src/libCom/osi/epicsSpin.h b/src/libCom/osi/epicsSpin.h new file mode 100644 index 000000000..06bc44a09 --- /dev/null +++ b/src/libCom/osi/epicsSpin.h @@ -0,0 +1,31 @@ +/*************************************************************************\ +* Copyright (c) 2012 Helmholtz-Zentrum Berlin +* fuer Materialien und Energie GmbH. +* Copyright (c) 2012 ITER Organization. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ + +#ifndef epicsSpinh +#define epicsSpinh + +#include "shareLib.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct epicsSpin *epicsSpinId; + +epicsShareFunc epicsSpinId epicsSpinCreate(); +epicsShareFunc void epicsSpinDestroy(epicsSpinId); + +epicsShareFunc void epicsSpinLock(epicsSpinId); +epicsShareFunc int epicsSpinTryLock(epicsSpinId); +epicsShareFunc void epicsSpinUnlock(epicsSpinId); + +#ifdef __cplusplus +} +#endif + +#endif /* epicsSpinh */ diff --git a/src/libCom/osi/os/default/osdSpin.c b/src/libCom/osi/os/default/osdSpin.c new file mode 100644 index 000000000..0f945d0f2 --- /dev/null +++ b/src/libCom/osi/os/default/osdSpin.c @@ -0,0 +1,71 @@ +/*************************************************************************\ +* Copyright (c) 2012 Helmholtz-Zentrum Berlin +* fuer Materialien und Energie GmbH. +* Copyright (c) 2012 ITER Organization. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ + +/* + * Author: Ralph Lange + */ + +#include "errlog.h" +#include "epicsMutex.h" +#include "epicsSpin.h" + +/* + * Default: EPICS MUTEX IMPLEMENTATION + */ + +typedef struct epicsSpin { + epicsMutexId lock; +} epicsSpin; + +epicsSpinId epicsSpinCreate() { + epicsSpin *spin; + + spin = calloc(1, sizeof(*spin)); + if (!spin) + goto fail; + + spin->lock = epicsMutexCreate(); + if (!spin->lock) + goto fail; + + return spin; + +fail: + free(spin); + return NULL; +} + +void epicsSpinDestroy(epicsSpinId spin) { + epicsMutexDestroy(spin->lock); + free(spin); +} + +void epicsSpinLock(epicsSpinId spin) { + epicsMutexLockStatus status; + + status = epicsMutexLock(spin->lock); + if (status != epicsMutexLockOK) { + errlogPrintf("epicsSpin epicsMutexLock failed: error %s\n", + status == epicsMutexLockTimeout ? "epicsMutexLockTimeout" : "epicsMutexLockError"); + } +} + +int epicsSpinTryLock(epicsSpinId spin) { + epicsMutexLockStatus status; + + status = epicsMutexTryLock(spin->lock); + if (status == epicsMutexLockOK) return 0; + if (status == epicsMutexLockTimeout) return 1; + + errlogPrintf("epicsSpin epicsMutexTryLock failed: error epicsMutexLockError\n"); + return 2; +} + +void epicsSpinUnlock(epicsSpinId spin) { + epicsMutexUnlock(spin->lock); +} diff --git a/src/libCom/osi/os/posix/osdSpin.c b/src/libCom/osi/os/posix/osdSpin.c new file mode 100644 index 000000000..71c34cca8 --- /dev/null +++ b/src/libCom/osi/os/posix/osdSpin.c @@ -0,0 +1,154 @@ +/*************************************************************************\ +* Copyright (c) 2012 Helmholtz-Zentrum Berlin +* fuer Materialien und Energie GmbH. +* Copyright (c) 2012 ITER Organization. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ + +/* + * Author: Ralph Lange + */ + +#include +#include +#include +#include +#include + +#include "errlog.h" +#include "epicsSpin.h" + +#define checkStatus(status,message) \ + if ((status)) { \ + errlogPrintf("epicsSpin %s failed: error %s\n", \ + (message), strerror((status))); \ + } + +#if defined(_POSIX_SPIN_LOCKS) && (_POSIX_SPIN_LOCKS > 1) + +/* + * POSIX SPIN LOCKS IMPLEMENTATION + */ + +typedef struct epicsSpin { + pthread_spinlock_t lock; +} epicsSpin; + +epicsSpinId epicsSpinCreate() { + epicsSpin *spin; + int status; + + spin = calloc(1, sizeof(*spin)); + if (!spin) + goto fail; + + status = pthread_spin_init(&spin->lock, PTHREAD_PROCESS_PRIVATE); + checkStatus(status, "pthread_spin_init"); + if (status) + goto fail; + + return spin; + +fail: + free(spin); + return NULL; +} + +void epicsSpinDestroy(epicsSpinId spin) { + int status; + + status = pthread_spin_destroy(&spin->lock); + checkStatus(status, "pthread_spin_destroy"); + + free(spin); +} + +void epicsSpinLock(epicsSpinId spin) { + int status; + + status = pthread_spin_lock(&spin->lock); + checkStatus(status, "pthread_spin_lock"); +} + +int epicsSpinTryLock(epicsSpinId spin) { + int status; + + status = pthread_spin_trylock(&spin->lock); + if (status == EBUSY) + return 1; + checkStatus(status, "pthread_spin_trylock"); + return 0; +} + +void epicsSpinUnlock(epicsSpinId spin) { + int status; + + status = pthread_spin_unlock(&spin->lock); + checkStatus(status, "pthread_spin_unlock"); +} + +#else /* defined(_POSIX_SPIN_LOCKS) && (_POSIX_SPIN_LOCKS > 1) */ + +/* + * POSIX MUTEX IMPLEMENTATION + */ + +typedef struct epicsSpin { + pthread_mutex_t lock; +} epicsSpin; + +epicsSpinId epicsSpinCreate() { + epicsSpin *spin; + int status; + + spin = calloc(1, sizeof(*spin)); + if (!spin) + goto fail; + + status = pthread_mutex_init(&spin->lock, NULL); + checkStatus(status, "pthread_mutex_init"); + if (status) + goto fail; + + return spin; + +fail: + free(spin); + return NULL; +} + +void epicsSpinDestroy(epicsSpinId spin) { + int status; + + status = pthread_mutex_destroy(&spin->lock); + checkStatus(status, "pthread_mutex_destroy"); + + free(spin); +} + +void epicsSpinLock(epicsSpinId spin) { + int status; + + status = pthread_mutex_lock(&spin->lock); + checkStatus(status, "pthread_mutex_lock"); +} + +int epicsSpinTryLock(epicsSpinId spin) { + int status; + + status = pthread_mutex_trylock(&spin->lock); + if (status == EBUSY) + return 1; + checkStatus(status, "pthread_mutex_trylock"); + return 0; +} + +void epicsSpinUnlock(epicsSpinId spin) { + int status; + + status = pthread_mutex_unlock(&spin->lock); + checkStatus(status, "pthread_mutex_unlock"); +} + +#endif /* defined(_POSIX_SPIN_LOCKS) && (_POSIX_SPIN_LOCKS > 1) */ diff --git a/src/libCom/osi/os/vxWorks/osdSpin.c b/src/libCom/osi/os/vxWorks/osdSpin.c new file mode 100644 index 000000000..89019738c --- /dev/null +++ b/src/libCom/osi/os/vxWorks/osdSpin.c @@ -0,0 +1,52 @@ +/*************************************************************************\ +* Copyright (c) 2012 Helmholtz-Zentrum Berlin +* fuer Materialien und Energie GmbH. +* Copyright (c) 2012 ITER Organization. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ + +/* + * Author: Ralph Lange + * + * based on epicsInterrupt.c (vxWorks implementation) by Marty Kraimer + */ + +/* + * vxWorks (single CPU): LOCK INTERRUPT + * + * CAVEAT: + * This implementation will break on vxWorks SMP architectures. + * These architectures provide spinlocks, which will have to be used. + * + */ + +#include +#include + +#include "epicsSpin.h" + +typedef struct epicsSpin { + int key; +} epicsSpin; + +epicsSpinId epicsSpinCreate() { + return calloc(1, sizeof(*spin)); +} + +void epicsSpinDestroy(epicsSpinId spin) { + free(spin); +} + +void epicsSpinLock(epicsSpinId spin) { + spin->key = intLock(); +} + +int epicsSpinTryLock(epicsSpinId spin) { + epicsSpinLock(spin); + return 0; +} + +void epicsSpinUnlock(epicsSpinId spin) { + intUnlock(spin->key); +} From 3f18327d2dee28baacb711b5d11d3d081a83af31 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Mon, 29 Oct 2012 20:26:11 +0100 Subject: [PATCH 3/6] libCom/osi: add tests for epicsSpin (based on epicsMutex tests) --- src/libCom/test/Makefile | 5 + src/libCom/test/epicsSpinTest.c | 183 ++++++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 src/libCom/test/epicsSpinTest.c diff --git a/src/libCom/test/Makefile b/src/libCom/test/Makefile index 2f73d8e43..3311f50cc 100644 --- a/src/libCom/test/Makefile +++ b/src/libCom/test/Makefile @@ -124,6 +124,11 @@ epicsMutexTest_SRCS += epicsMutexTest.cpp testHarness_SRCS += epicsMutexTest.cpp TESTS += epicsMutexTest +TESTPROD_HOST += epicsSpinTest +epicsSpinTest_SRCS += epicsSpinTest.c +testHarness_SRCS += epicsSpinTest.c +TESTS += epicsSpinTest + TESTPROD_HOST += epicsAtomicTest epicsAtomicTest_SRCS += epicsAtomicTest.cpp testHarness_SRCS += epicsAtomicTest.cpp diff --git a/src/libCom/test/epicsSpinTest.c b/src/libCom/test/epicsSpinTest.c new file mode 100644 index 000000000..02821add7 --- /dev/null +++ b/src/libCom/test/epicsSpinTest.c @@ -0,0 +1,183 @@ +/*************************************************************************\ +* Copyright (c) 2012 Helmholtz-Zentrum Berlin +* fuer Materialien und Energie GmbH. +* Copyright (c) 2012 ITER Organization. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ + +/* + * Author: Ralph Lange + * + * based on epicsMutexTest by Marty Kraimer and Jeff Hill + * + */ + +#include +#include +#include +#include +#include +#include + +#include "epicsTime.h" +#include "epicsThread.h" +#include "epicsSpin.h" +#include "epicsEvent.h" +#include "errlog.h" +#include "epicsUnitTest.h" +#include "testMain.h" + +typedef struct info { + int threadnum; + epicsSpinId spin; + int quit; +} info; + +void spinThread(void *arg) +{ + info *pinfo = (info *) arg; + testDiag("spinThread %d starting", pinfo->threadnum); + while (pinfo->quit--) { + epicsSpinLock(pinfo->spin); + testPass("spinThread %d epicsSpinLock taken", pinfo->threadnum); + epicsThreadSleep(.1); + epicsSpinUnlock(pinfo->spin); + epicsThreadSleep(.9); + } + testDiag("spinThread %d exiting", pinfo->threadnum); + return; +} + +inline void lockPair(struct epicsSpin *spin) +{ + epicsSpinLock(spin); + epicsSpinUnlock(spin); +} + +inline void tenLockPairs(struct epicsSpin *spin) +{ + lockPair(spin); + lockPair(spin); + lockPair(spin); + lockPair(spin); + lockPair(spin); + lockPair(spin); + lockPair(spin); + lockPair(spin); + lockPair(spin); + lockPair(spin); +} + +inline void tenLockPairsSquared(struct epicsSpin *spin) +{ + tenLockPairs(spin); + tenLockPairs(spin); + tenLockPairs(spin); + tenLockPairs(spin); + tenLockPairs(spin); + tenLockPairs(spin); + tenLockPairs(spin); + tenLockPairs(spin); + tenLockPairs(spin); + tenLockPairs(spin); +} + +void epicsSpinPerformance () +{ + unsigned i; + epicsSpinId spin; + epicsTimeStamp begin; + epicsTimeStamp end; + + /* Initialize spinlock */ + spin = epicsSpinCreate(); + + /* test a single lock pair */ + epicsTimeGetCurrent(&begin); + static const unsigned N = 10000; + for ( i = 0; i < N; i++ ) { + tenLockPairsSquared(spin); + } + epicsTimeGetCurrent(&end); + double delay = epicsTimeDiffInSeconds(&end, &begin); + delay /= N * 100u; // convert to delay per lock pair + delay *= 1e6; // convert to micro seconds + testDiag("lock()*1/unlock()*1 takes %f microseconds", delay); +} + +struct verifyTryLock { + epicsSpinId spin; + epicsEventId done; +}; + +void verifyTryLockThread(void *pArg) +{ + struct verifyTryLock *pVerify = + (struct verifyTryLock *) pArg; + + testOk1(epicsSpinTryLock(pVerify->spin)); + epicsEventSignal(pVerify->done); +} + +void verifyTryLock() +{ + struct verifyTryLock verify; + + verify.spin = epicsSpinCreate(); + verify.done = epicsEventMustCreate(epicsEventEmpty); + + testOk1(epicsSpinTryLock(verify.spin) == 0); + + epicsThreadCreate("verifyTryLockThread", 40, + epicsThreadGetStackSize(epicsThreadStackSmall), + verifyTryLockThread, &verify); + + testOk1(epicsEventWait(verify.done) == epicsEventWaitOK); + + epicsSpinUnlock(verify.spin); + epicsSpinDestroy(verify.spin); + epicsEventDestroy(verify.done); +} + +MAIN(epicsSpinTest) +{ + const int nthreads = 3; + const int nrounds = 5; + unsigned int stackSize; + epicsThreadId *id; + int i; + char **name; + void **arg; + info **pinfo; + epicsSpinId spin; + + testPlan(3 + nthreads * nrounds); + + verifyTryLock(); + + spin = epicsSpinCreate(); + + id = (epicsThreadId *) calloc(nthreads, sizeof(epicsThreadId)); + name = (char **) calloc(nthreads, sizeof(char *)); + arg = (void **) calloc(nthreads, sizeof(void *)); + pinfo = (info **) calloc(nthreads, sizeof(info *)); + stackSize = epicsThreadGetStackSize(epicsThreadStackSmall); + for (i = 0; i < nthreads; i++) { + name[i] = (char *) calloc(10, sizeof(char)); + sprintf(name[i],"task%d",i); + pinfo[i] = (info *) calloc(1, sizeof(info)); + pinfo[i]->threadnum = i; + pinfo[i]->spin = spin; + pinfo[i]->quit = nrounds; + arg[i] = pinfo[i]; + id[i] = epicsThreadCreate(name[i], 40, stackSize, + spinThread, + arg[i]); + } + epicsThreadSleep(2.0 + nrounds); + + epicsSpinPerformance(); + + return testDone(); +} From f320cbcecdbadc53cd96b2f2a631659ef8bdb375 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 20 Nov 2012 15:04:28 -0600 Subject: [PATCH 4/6] Fix vxWorks implementation. --- src/libCom/osi/os/vxWorks/osdSpin.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libCom/osi/os/vxWorks/osdSpin.c b/src/libCom/osi/os/vxWorks/osdSpin.c index 89019738c..9b545347d 100644 --- a/src/libCom/osi/os/vxWorks/osdSpin.c +++ b/src/libCom/osi/os/vxWorks/osdSpin.c @@ -16,12 +16,12 @@ * vxWorks (single CPU): LOCK INTERRUPT * * CAVEAT: - * This implementation will break on vxWorks SMP architectures. - * These architectures provide spinlocks, which will have to be used. + * This implementation will not compile on vxWorks SMP architectures. + * These architectures provide spinlocks, which must be used instead. * */ -#include +#include #include #include "epicsSpin.h" @@ -31,7 +31,7 @@ typedef struct epicsSpin { } epicsSpin; epicsSpinId epicsSpinCreate() { - return calloc(1, sizeof(*spin)); + return calloc(1, sizeof(epicsSpin)); } void epicsSpinDestroy(epicsSpinId spin) { From 7778c0c3ffcf10087b3f7b1dced59c9f159dbda1 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 20 Nov 2012 15:55:53 -0600 Subject: [PATCH 5/6] Solaris & vxWorks 5.5.x fixes Remove C++-isms. Make internal routines static when duplicate names appear in the epicsMutexTest.cpp code; on vxWorks and RTEMS all test programs get linked into a single binary. --- src/libCom/test/epicsSpinTest.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/libCom/test/epicsSpinTest.c b/src/libCom/test/epicsSpinTest.c index 02821add7..707345b89 100644 --- a/src/libCom/test/epicsSpinTest.c +++ b/src/libCom/test/epicsSpinTest.c @@ -49,13 +49,13 @@ void spinThread(void *arg) return; } -inline void lockPair(struct epicsSpin *spin) +static void lockPair(struct epicsSpin *spin) { epicsSpinLock(spin); epicsSpinUnlock(spin); } -inline void tenLockPairs(struct epicsSpin *spin) +static void tenLockPairs(struct epicsSpin *spin) { lockPair(spin); lockPair(spin); @@ -69,7 +69,7 @@ inline void tenLockPairs(struct epicsSpin *spin) lockPair(spin); } -inline void tenLockPairsSquared(struct epicsSpin *spin) +static void tenLockPairsSquared(struct epicsSpin *spin) { tenLockPairs(spin); tenLockPairs(spin); @@ -85,24 +85,26 @@ inline void tenLockPairsSquared(struct epicsSpin *spin) void epicsSpinPerformance () { + static const unsigned N = 10000; unsigned i; epicsSpinId spin; epicsTimeStamp begin; epicsTimeStamp end; + double delay; /* Initialize spinlock */ spin = epicsSpinCreate(); /* test a single lock pair */ epicsTimeGetCurrent(&begin); - static const unsigned N = 10000; for ( i = 0; i < N; i++ ) { tenLockPairsSquared(spin); } epicsTimeGetCurrent(&end); - double delay = epicsTimeDiffInSeconds(&end, &begin); - delay /= N * 100u; // convert to delay per lock pair - delay *= 1e6; // convert to micro seconds + + delay = epicsTimeDiffInSeconds(&end, &begin); + delay /= N * 100u; /* convert to delay per lock pair */ + delay *= 1e6; /* convert to micro seconds */ testDiag("lock()*1/unlock()*1 takes %f microseconds", delay); } @@ -111,7 +113,7 @@ struct verifyTryLock { epicsEventId done; }; -void verifyTryLockThread(void *pArg) +static void verifyTryLockThread(void *pArg) { struct verifyTryLock *pVerify = (struct verifyTryLock *) pArg; @@ -120,7 +122,7 @@ void verifyTryLockThread(void *pArg) epicsEventSignal(pVerify->done); } -void verifyTryLock() +static void verifyTryLock() { struct verifyTryLock verify; From d69f3904d7bcbaee31ca4d7abf7735a5a18b3a75 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 20 Nov 2012 17:27:38 -0600 Subject: [PATCH 6/6] Fix for win32 builds. --- src/libCom/osi/os/default/osdSpin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libCom/osi/os/default/osdSpin.c b/src/libCom/osi/os/default/osdSpin.c index 0f945d0f2..70d9fbace 100644 --- a/src/libCom/osi/os/default/osdSpin.c +++ b/src/libCom/osi/os/default/osdSpin.c @@ -10,6 +10,9 @@ * Author: Ralph Lange */ +#include + +#define epicsExportSharedSymbols #include "errlog.h" #include "epicsMutex.h" #include "epicsSpin.h"