aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2019-01-20 14:20:27 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2019-01-20 14:20:27 +0000
commitc7024d3cc6bd7e769c2a500d95a770d69e28969e (patch)
treef6dd4c5619f7ba530512fe460104f86aef32da32 /os
parentc16c4e516e52798a688af478eea474df093ed16b (diff)
downloadChibiOS-c7024d3cc6bd7e769c2a500d95a770d69e28969e.tar.gz
ChibiOS-c7024d3cc6bd7e769c2a500d95a770d69e28969e.tar.bz2
ChibiOS-c7024d3cc6bd7e769c2a500d95a770d69e28969e.zip
Added chMtxGetOwnerI().
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12562 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os')
-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.