Mutex Locker utility class to lock/unlock mbed RTOS mutexes. Create and pass a mutex, it locks the mutex then unlocks it when destroyed.

Dependents:   SmartLight HelloThreadsYo

Embed: (wiki syntax)

« Back to documentation index

MutexLocker Class Reference

MutexLocker Class Reference

Lock/Unlock Mutex using variable scope. More...

#include <mutexlocker.h>

Public Member Functions

 MutexLocker (Mutex &mutex)
 Lock the mutex.
 ~MutexLocker ()
 Unlocks on destruction.

Detailed Description

Lock/Unlock Mutex using variable scope.

Ensures always unlocked regardless of method exit

Definition at line 13 of file mutexlocker.h.


Constructor & Destructor Documentation

MutexLocker ( Mutex &  mutex )

Lock the mutex.

Definition at line 17 of file mutexlocker.h.

~MutexLocker (  )

Unlocks on destruction.

Definition at line 22 of file mutexlocker.h.