rtos: Add ScopedMutexLock typedef

pull/5852/head
Maciej Bocianski 2018-01-15 07:59:30 +01:00
parent a3c9c124f7
commit cde5196170
1 changed files with 15 additions and 0 deletions

View File

@ -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
* @{