aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src/chmtx.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel/src/chmtx.c')
-rw-r--r--os/kernel/src/chmtx.c55
1 files changed, 24 insertions, 31 deletions
diff --git a/os/kernel/src/chmtx.c b/os/kernel/src/chmtx.c
index 9d66022c2..d5335c0aa 100644
--- a/os/kernel/src/chmtx.c
+++ b/os/kernel/src/chmtx.c
@@ -18,8 +18,9 @@
*/
/**
- * @file chmtx.c
- * @brief Mutexes code.
+ * @file chmtx.c
+ * @brief Mutexes code.
+ *
* @addtogroup mutexes
* @{
*/
@@ -29,12 +30,9 @@
#if CH_USE_MUTEXES
/**
- * @brief Initializes s @p Mutex structure.
+ * @brief Initializes s @p Mutex structure.
*
- * @param[out] mp pointer to a @p Mutex structure
- * @note This function can be invoked from within an interrupt handler even if
- * it is not an I-Class API because it does not touch any critical kernel
- * data structure.
+ * @param[out] mp pointer to a @p Mutex structure
*/
void chMtxInit(Mutex *mp) {
@@ -45,9 +43,9 @@ void chMtxInit(Mutex *mp) {
}
/**
- * @brief Locks the specified mutex.
+ * @brief Locks the specified mutex.
*
- * @param[in] mp pointer to the @p Mutex structure
+ * @param[in] mp pointer to the @p Mutex structure
*/
void chMtxLock(Mutex *mp) {
@@ -59,11 +57,9 @@ void chMtxLock(Mutex *mp) {
}
/**
- * @brief Locks the specified mutex.
+ * @brief Locks the specified mutex.
*
- * @param[in] mp pointer to the @p Mutex structure
- * @note This function must be called within a @p chSysLock() / @p chSysUnlock()
- * block.
+ * @param[in] mp pointer to the @p Mutex structure
*/
void chMtxLockS(Mutex *mp) {
Thread *ctp = currp;
@@ -121,14 +117,14 @@ void chMtxLockS(Mutex *mp) {
}
/**
- * @brief Tries to lock a mutex.
+ * @brief Tries to lock a mutex.
* @details This function does not have any overhead related to
* the priority inheritance mechanism because it does not try to
* enter a sleep state on the mutex.
*
- * @param[in] mp pointer to the @p Mutex structure
- * @retval TRUE if the mutex was successfully acquired
- * @retval FALSE if the lock attempt failed.
+ * @param[in] mp pointer to the @p Mutex structure
+ * @retval TRUE if the mutex was successfully acquired
+ * @retval FALSE if the lock attempt failed.
*/
bool_t chMtxTryLock(Mutex *mp) {
bool_t b;
@@ -142,15 +138,14 @@ bool_t chMtxTryLock(Mutex *mp) {
}
/**
- * @brief Tries to lock a mutex.
+ * @brief Tries to lock a mutex.
* @details This function does not have any overhead related to
* the priority inheritance mechanism because it does not try to
* enter a sleep state on the mutex.
- * @param[in] mp pointer to the @p Mutex structure
- * @retval TRUE if the mutex was successfully acquired
- * @retval FALSE if the lock attempt failed.
- * @note This function must be called within a @p chSysLock() / @p chSysUnlock()
- * block.
+ *
+ * @param[in] mp pointer to the @p Mutex structure
+ * @retval TRUE if the mutex was successfully acquired
+ * @retval FALSE if the lock attempt failed.
*/
bool_t chMtxTryLockS(Mutex *mp) {
@@ -165,9 +160,9 @@ bool_t chMtxTryLockS(Mutex *mp) {
}
/**
- * @brief Unlocks the next owned mutex in reverse lock order.
+ * @brief Unlocks the next owned mutex in reverse lock order.
*
- * @return The pointer to the unlocked mutex.
+ * @return The pointer to the unlocked mutex.
*/
Mutex *chMtxUnlock(void) {
Thread *ctp = currp;
@@ -210,12 +205,10 @@ Mutex *chMtxUnlock(void) {
}
/**
- * @brief Unlocks the next owned mutex in reverse lock order.
+ * @brief Unlocks the next owned mutex in reverse lock order.
+ * @note This function does not reschedule internally.
*
- * @return The pointer to the unlocked mutex.
- * @note This function must be called within a @p chSysLock() / @p chSysUnlock()
- * block.
- * @note This function does not reschedule internally.
+ * @return The pointer to the unlocked mutex.
*/
Mutex *chMtxUnlockS(void) {
Thread *ctp = currp;
@@ -254,7 +247,7 @@ Mutex *chMtxUnlockS(void) {
}
/**
- * @brief Unlocks all the mutexes owned by the invoking thread.
+ * @brief Unlocks all the mutexes owned by the invoking thread.
* @details This function is <b>MUCH MORE</b> efficient than releasing the
* mutexes one by one and not just because the call overhead,
* this function does not have any overhead related to the priority