diff --git a/modules/libcom/src/osi/epicsThread.h b/modules/libcom/src/osi/epicsThread.h index 82fa04b5b..da16a0b25 100644 --- a/modules/libcom/src/osi/epicsThread.h +++ b/modules/libcom/src/osi/epicsThread.h @@ -124,7 +124,10 @@ epicsShareFunc epicsThreadId epicsShareAPI epicsThreadCreate ( epicsShareFunc epicsThreadId epicsShareAPI epicsThreadMustCreate ( const char * name, unsigned int priority, unsigned int stackSize, EPICSTHREADFUNC funptr,void * parm ); -/** Wait for a joinable thread to exit (return from its main function */ + +/* This gets undefined in osdThread.h on VxWorks < 6.9 */ +#define EPICS_THREAD_CAN_JOIN +/** Wait for a joinable thread to exit (return from its main function) */ epicsShareFunc void epicsThreadMustJoin(epicsThreadId id); /** Block the current thread until epicsThreadResume(). */ epicsShareFunc void epicsShareAPI epicsThreadSuspendSelf(void); diff --git a/modules/libcom/src/osi/os/Linux/osdThread.h b/modules/libcom/src/osi/os/Linux/osdThread.h index 40a837e9f..bb1fdcb0a 100644 --- a/modules/libcom/src/osi/os/Linux/osdThread.h +++ b/modules/libcom/src/osi/os/Linux/osdThread.h @@ -16,9 +16,6 @@ #include "ellLib.h" #include "epicsEvent.h" -/* This target supports joining threads */ -#define EPICS_THREAD_CAN_JOIN (1) - #ifdef __cplusplus extern "C" { #endif diff --git a/modules/libcom/src/osi/os/RTEMS/osdThread.h b/modules/libcom/src/osi/os/RTEMS/osdThread.h index 84d579c0f..4eef8c01f 100644 --- a/modules/libcom/src/osi/os/RTEMS/osdThread.h +++ b/modules/libcom/src/osi/os/RTEMS/osdThread.h @@ -3,13 +3,21 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. \*************************************************************************/ -/* This target supports joining threads */ -#define EPICS_THREAD_CAN_JOIN (1) +#ifndef INC_osdThread_H +#define INC_osdThread_H + +#ifdef __cplusplus +extern "C" { +#endif int epicsThreadGetOssPriorityValue(unsigned int osiPriority); +#ifdef __cplusplus +} +#endif + +#endif /* INC_osdThread_H */ diff --git a/modules/libcom/src/osi/os/WIN32/osdThread.h b/modules/libcom/src/osi/os/WIN32/osdThread.h index fe60564d1..69bc364f0 100644 --- a/modules/libcom/src/osi/os/WIN32/osdThread.h +++ b/modules/libcom/src/osi/os/WIN32/osdThread.h @@ -3,15 +3,11 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. \*************************************************************************/ #ifndef osdThreadh #define osdThreadh -/* This target supports joining threads */ -#define EPICS_THREAD_CAN_JOIN (1) - #endif /* osdThreadh */ diff --git a/modules/libcom/src/osi/os/posix/osdThread.h b/modules/libcom/src/osi/os/posix/osdThread.h index eee0c825d..8fe8f14eb 100644 --- a/modules/libcom/src/osi/os/posix/osdThread.h +++ b/modules/libcom/src/osi/os/posix/osdThread.h @@ -3,9 +3,8 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. \*************************************************************************/ #ifndef osdThreadh #define osdThreadh @@ -16,9 +15,6 @@ #include "ellLib.h" #include "epicsEvent.h" -/* This target supports joining threads */ -#define EPICS_THREAD_CAN_JOIN (1) - #ifdef __cplusplus extern "C" { #endif diff --git a/modules/libcom/src/osi/os/vxWorks/osdThread.c b/modules/libcom/src/osi/os/vxWorks/osdThread.c index d5b859ade..0ed31389f 100644 --- a/modules/libcom/src/osi/os/vxWorks/osdThread.c +++ b/modules/libcom/src/osi/os/vxWorks/osdThread.c @@ -34,7 +34,7 @@ #include "vxLib.h" #include "epicsExit.h" -#if EPICS_THREAD_CAN_JOIN +#ifdef EPICS_THREAD_CAN_JOIN /* The implementation of epicsThreadMustJoin() here uses 2 features * of VxWorks that were first introduced in VxWorks 6.9: taskWait(), * and the taskSpareFieldGet/Set routines in taskUtilLib. @@ -188,7 +188,7 @@ void epicsThreadOnce(epicsThreadOnceId *id, void (*func)(void *), void *arg) semGive(epicsThreadOnceMutex); } -#if EPICS_THREAD_CAN_JOIN +#ifdef EPICS_THREAD_CAN_JOIN /* This routine is not static so it appears in the back-trace * of a thread that is waiting to be joined. @@ -286,8 +286,8 @@ epicsThreadId epicsThreadCreateOpt(const char * name, void epicsThreadMustJoin(epicsThreadId id) { +#ifdef EPICS_THREAD_CAN_JOIN const char *fn = "epicsThreadMustJoin"; -#if EPICS_THREAD_CAN_JOIN int tid = (int) id; SEM_ID joinSem; STATUS status; @@ -340,8 +340,6 @@ void epicsThreadMustJoin(epicsThreadId id) } cantProceed(fn); } -#else - cantProceed("%s called when EPICS_THREAD_CAN_JOIN is 0\n", fn); #endif } diff --git a/modules/libcom/src/osi/os/vxWorks/osdThread.h b/modules/libcom/src/osi/os/vxWorks/osdThread.h index 8fa454ce3..15145663b 100644 --- a/modules/libcom/src/osi/os/vxWorks/osdThread.h +++ b/modules/libcom/src/osi/os/vxWorks/osdThread.h @@ -3,20 +3,17 @@ * National Laboratory. * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. -* EPICS BASE Versions 3.13.7 -* and higher are distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. \*************************************************************************/ + #ifndef osdThreadh #define osdThreadh /* VxWorks 6.9 and later can support joining threads */ -#if (_WRS_VXWORKS_MAJOR > 6) || \ - (_WRS_VXWORKS_MAJOR == 6 && _WRS_VXWORKS_MINOR >= 9) -# define EPICS_THREAD_CAN_JOIN (1) -#else -# define EPICS_THREAD_CAN_JOIN (0) +#if (_WRS_VXWORKS_MAJOR == 6 && _WRS_VXWORKS_MINOR < 9) +#undef EPICS_THREAD_CAN_JOIN #endif #endif /* osdThreadh */