teste de publish

Dependencies:   DS1820 HighSpeedAnalogIn devices mbed

Embed: (wiki syntax)

« Back to documentation index

Mutex Class Reference

Mutex Class Reference

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 33 of file Mutex.h.


Constructor & Destructor Documentation

Mutex (  )

Create and Initialize a Mutex object.

Definition at line 29 of file Mutex.cpp.


Member Function Documentation

osStatus lock ( uint32_t  millisec = osWaitForever )

Wait until a Mutex becomes available.

Parameters:
millisectimeout value or 0 in case of no time-out. (default: osWaitForever)
Returns:
status code that indicates the execution status of the function.

Definition at line 40 of file Mutex.cpp.

bool trylock (  )

Try to lock the mutex, and return immediately.

Returns:
true if the mutex was acquired, false otherwise.

Definition at line 44 of file Mutex.cpp.

osStatus unlock (  )

Unlock the mutex that has previously been locked by the same thread.

Returns:
status code that indicates the execution status of the function.

Definition at line 48 of file Mutex.cpp.