From d1f0435eb8bbfa1476de08052ba326637442a1c5 Mon Sep 17 00:00:00 2001 From: "W. Eric Norum" Date: Mon, 15 Apr 2002 19:35:31 +0000 Subject: [PATCH] Return epicsMutexLockTimeout on failure to lock in epicsMutexTryLock since that's the return code checked by the test programs. --- src/libCom/osi/os/RTEMS/osdMutex.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libCom/osi/os/RTEMS/osdMutex.c b/src/libCom/osi/os/RTEMS/osdMutex.c index 8152c107e..583f9ef0e 100644 --- a/src/libCom/osi/os/RTEMS/osdMutex.c +++ b/src/libCom/osi/os/RTEMS/osdMutex.c @@ -80,7 +80,7 @@ epicsMutexOsdCreate(void) the_semaphore = _Semaphore_Get( sid, &location ); _Thread_Enable_dispatch(); - return the_semaphore; + return (epicsMutexId)the_semaphore; } #endif return (epicsMutexId)sid; @@ -206,8 +206,10 @@ epicsMutexLockStatus epicsMutexTryLock(epicsMutexId id) 0, /* same as passed to obtain -- ticks */ level ); - if (_Thread_Executing->Wait.return_code == 0) + if (_Thread_Executing->Wait.return_code == CORE_MUTEX_STATUS_SUCCESSFUL) return epicsMutexLockOK; + else if (_Thread_Executing->Wait.return_code == CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT) + return epicsMutexLockTimeout; else return epicsMutexLockError; #else @@ -228,5 +230,5 @@ epicsShareFunc void epicsMutexShow(epicsMutexId id,unsigned int level) Semaphore_Control *the_semaphore = (Semaphore_Control *)id; id = (epicsMutexId)the_semaphore->Object.id; #endif - epicsEventShow (id,level); + epicsEventShow ((epicsEventId)id,level); }