summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/apimutexisowner.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-27 11:43:44 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-27 12:24:24 +0200
commitec84273de4fe79c338677b7d519ebdcd610a50c4 (patch)
treefd05b2c087320e372b1728315aad88a19d3de1e7 /cpukit/score/src/apimutexisowner.c
parentsapi: Fix workspace size estimate (diff)
downloadrtems-ec84273de4fe79c338677b7d519ebdcd610a50c4.tar.bz2
score: Replace _API_Mutex_Is_locked()
Replace _API_Mutex_Is_locked() with _API_Mutex_Is_owner().
Diffstat (limited to 'cpukit/score/src/apimutexisowner.c')
-rw-r--r--cpukit/score/src/apimutexisowner.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/cpukit/score/src/apimutexisowner.c b/cpukit/score/src/apimutexisowner.c
new file mode 100644
index 0000000000..a80c664cb3
--- /dev/null
+++ b/cpukit/score/src/apimutexisowner.c
@@ -0,0 +1,26 @@
+/**
+ * @file
+ *
+ * @ingroup ScoreAPIMutex
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2015.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/apimutex.h>
+#include <rtems/score/threadimpl.h>
+
+bool _API_Mutex_Is_owner( const API_Mutex_Control *the_mutex )
+{
+ return the_mutex->Mutex.holder == _Thread_Get_executing();
+}