Official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard.

Dependents:   denki-yohou_b TestY201 Network-RTOS NTPClient_HelloWorld ... more

Embed: (wiki syntax)

« Back to documentation index

Mutex Class Reference

Mutex Class Reference
[Rtos]

The Mutex class is used to synchronise the execution of threads. More...

#include <Mutex.h>

Public Member Functions

 Mutex ()
 Create and Initialize a Mutex object.
osStatus lock (uint32_t millisec=osWaitForever)
 Wait until a Mutex becomes available.
bool trylock ()
 Try to lock the mutex, and return immediately.
osStatus unlock ()
 Unlock the mutex that has previously been locked by the same thread.

Detailed Description

The Mutex class is used to synchronise the execution of threads.

This is for example used to protect access to a shared resource.

Definition at line 35 of file Mutex.h.


Constructor & Destructor Documentation

Mutex (  )

Create and Initialize a Mutex object.

Definition at line 29 of file Mutex.cpp.