ON Semiconductor / mbed-os

Dependents:   mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510

Embed: (wiki syntax)

« Back to documentation index

LockGuard Class Reference

LockGuard Class Reference

RAII mutex locker. More...

#include <LockGuard.h>

Public Member Functions

 LockGuard (rtos::Mutex &mutex)
 Construct a LockGuard instance and ackire ownership of mutex in input.
 ~LockGuard ()
 Destruct the lock and release the inner mutex.

Detailed Description

RAII mutex locker.

The mutex pass in the constructor will be locked for the lifetime of the LockGuard instance.

Definition at line 28 of file LockGuard.h.


Constructor & Destructor Documentation

LockGuard ( rtos::Mutex mutex )

Construct a LockGuard instance and ackire ownership of mutex in input.

Parameters:
mutexThe mutex to ackire ownership of.

Definition at line 34 of file LockGuard.h.

~LockGuard (  )

Destruct the lock and release the inner mutex.

Definition at line 41 of file LockGuard.h.