diff options
Diffstat (limited to '')
-rw-r--r-- | cpukit/posix/src/mutextrylock.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/cpukit/posix/src/mutextrylock.c b/cpukit/posix/src/mutextrylock.c index d029ae5de6..895f38fa44 100644 --- a/cpukit/posix/src/mutextrylock.c +++ b/cpukit/posix/src/mutextrylock.c @@ -18,14 +18,7 @@ #include "config.h" #endif -#include <errno.h> -#include <pthread.h> - -#include <rtems/system.h> -#include <rtems/score/coremuteximpl.h> -#include <rtems/score/watchdog.h> #include <rtems/posix/muteximpl.h> -#include <rtems/posix/priorityimpl.h> /** * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 @@ -36,8 +29,17 @@ int pthread_mutex_trylock( pthread_mutex_t *mutex ) { - int r = _POSIX_Mutex_Lock_support( mutex, false, WATCHDOG_NO_TIMEOUT ); - if ( r == EDEADLK ) - r = EBUSY; - return r; + int eno; + + eno = _POSIX_Mutex_Lock_support( + mutex, + (const struct timespec *) POSIX_MUTEX_ABSTIME_TRY_LOCK, + NULL + ); + + if ( eno == EDEADLK ) { + eno = EBUSY; + } + + return eno; } |