aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include/chmtx.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt/include/chmtx.h')
-rw-r--r--os/rt/include/chmtx.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/os/rt/include/chmtx.h b/os/rt/include/chmtx.h
index 069e146cf..b4df78bcf 100644
--- a/os/rt/include/chmtx.h
+++ b/os/rt/include/chmtx.h
@@ -133,6 +133,22 @@ static inline bool chMtxQueueNotEmptyS(mutex_t *mp) {
}
/**
+ * @brief Returns the mutex owner thread.
+ *
+ * @param[out] mp pointer to a @p mutex_t structure
+ * @return The owner thread.
+ * @retval NULL if the mutex is not owned.
+ *
+ * @iclass
+ */
+static inline thread_t *chMtxGetOwnerI(mutex_t *mp) {
+
+ chDbgCheckClassI();
+
+ return mp->owner;
+}
+
+/**
* @brief Returns the next mutex in the mutexes stack of the current thread.
*
* @return A pointer to the next mutex in the stack.