Skip to content

Commit efc28a2

Browse files
bulislaw0xc0170
authored andcommitted
RTOS: Mutex: Improve API docs
1 parent 623c7ae commit efc28a2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

rtos/Mutex.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,26 @@ class Mutex : private mbed::NonCopyable<Mutex> {
5353

5454
/** Wait until a Mutex becomes available.
5555
@param millisec timeout value or 0 in case of no time-out. (default: osWaitForever)
56-
@return status code that indicates the execution status of the function.
56+
@return status code that indicates the execution status of the function:
57+
@a osOK the mutex has been obtained.
58+
@a osErrorTimeout the mutex could not be obtained in the given time.
59+
@a osErrorParameter internal error.
60+
@a osErrorResource the mutex could not be obtained when no timeout was specified.
61+
@a osErrorISR this function cannot be called from the interrupt service routine.
5762
*/
5863
osStatus lock(uint32_t millisec=osWaitForever);
5964

6065
/** Try to lock the mutex, and return immediately
61-
@return true if the mutex was acquired, false otherwise.
66+
@return true if the mutex was acquired, false otherwise.
6267
*/
6368
bool trylock();
6469

6570
/** Unlock the mutex that has previously been locked by the same thread
66-
@return status code that indicates the execution status of the function.
71+
@return status code that indicates the execution status of the function:
72+
@a osOK the mutex has been released.
73+
@a osErrorParameter internal error.
74+
@a osErrorResource the mutex was not locked or the current thread wasn't the owner.
75+
@a osErrorISR this function cannot be called from the interrupt service routine.
6776
*/
6877
osStatus unlock();
6978

0 commit comments

Comments
 (0)