mirror of https://github.com/ARMmbed/mbed-os.git
rtos: Add ScopedMutexLock typedef
parent
a3c9c124f7
commit
cde5196170
15
rtos/Mutex.h
15
rtos/Mutex.h
|
@ -28,10 +28,25 @@
|
|||
#include "mbed_rtos_storage.h"
|
||||
|
||||
#include "platform/NonCopyable.h"
|
||||
#include "platform/ScopedLock.h"
|
||||
|
||||
namespace rtos {
|
||||
/** \addtogroup rtos */
|
||||
/** @{*/
|
||||
|
||||
class Mutex;
|
||||
/** Typedef for the mutex lock
|
||||
*
|
||||
* Usage:
|
||||
* @code
|
||||
* void foo(Mutex &m) {
|
||||
* ScopedMutexLock lock(m);
|
||||
* // Code in this block will be protected by Mutex lock
|
||||
* }
|
||||
* @endcode
|
||||
*/
|
||||
typedef mbed::ScopedLock<Mutex> ScopedMutexLock;
|
||||
|
||||
/**
|
||||
* \defgroup rtos_Mutex Mutex class
|
||||
* @{
|
||||
|
|
Loading…
Reference in New Issue