summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorChristian Mauderer <christian.mauderer@embedded-brains.de>2021-05-26 11:26:59 +0200
committerChristian Mauderer <christian.mauderer@embedded-brains.de>2021-05-28 08:22:04 +0200
commit156896526f0579b5021e90f026286c62c2340efb (patch)
tree51fcd8cb885a80446b05207931c7e079ca59bfa6 /cpukit
parent023a27096223e33be1cdd3f8d2ccf11caeda72b1 (diff)
downloadrtems-156896526f0579b5021e90f026286c62c2340efb.tar.bz2
thread-API: Add rtems_*mutex_try_lock
This adds a rtems_mutex_try_lock and a rtems_recursive_mutex_try_lock. Update #4440.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/include/rtems/thread.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpukit/include/rtems/thread.h b/cpukit/include/rtems/thread.h
index feee612d22..d0cb03c284 100644
--- a/cpukit/include/rtems/thread.h
+++ b/cpukit/include/rtems/thread.h
@@ -54,6 +54,11 @@ static __inline void rtems_mutex_lock( rtems_mutex *mutex )
_Mutex_Acquire( mutex );
}
+static __inline int rtems_mutex_try_lock( rtems_mutex *mutex )
+{
+ return _Mutex_Try_acquire( mutex );
+}
+
static __inline void rtems_mutex_unlock( rtems_mutex *mutex )
{
_Mutex_Release( mutex );
@@ -97,6 +102,13 @@ static __inline void rtems_recursive_mutex_lock(
_Mutex_recursive_Acquire( mutex );
}
+static __inline int rtems_recursive_mutex_try_lock(
+ rtems_recursive_mutex *mutex
+)
+{
+ return _Mutex_recursive_Try_acquire( mutex );
+}
+
static __inline void rtems_recursive_mutex_unlock(
rtems_recursive_mutex *mutex
)