Ethernetwebsoc

Dependencies:   C12832_lcd LM75B WebSocketClient mbed-rtos mbed Socket lwip-eth lwip-sys lwip

Embed: (wiki syntax)

« Back to documentation index

Mutex Class Reference

Mutex Class Reference

#include <Mutex.h>

Public Member Functions

 Mutex ()
osStatus lock (uint32_t millisec=osWaitForever)
bool trylock ()
osStatus unlock ()

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


Constructor & Destructor Documentation

Mutex (  )

Create and Initialize a Mutex object

Definition at line 8 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 19 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 23 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 27 of file Mutex.cpp.