37#ifndef FREERTOSPP_LOCK_H_
38#define FREERTOSPP_LOCK_H_
42#if FREERTOSCPP_USE_NAMESPACE
63 virtual bool take(TickType_t wait = portMAX_DELAY) = 0;
64#if FREERTOSCPP_USE_CHRONO
65 bool take(Time_ms ms) {
return take(ms2ticks(ms)); }
69#if __cplusplus < 201101L
123 Lock(
Lockable& mylockable,
bool mylocked =
true, TickType_t wait = portMAX_DELAY);
130#if FREERTOSCPP_USE_CHRONO
135 bool lock(TickType_t wait = portMAX_DELAY);
136#if FREERTOSCPP_USE_CHRONO
137 bool lock(Time_ms ms) {
return lock(ms2ticks(ms)); }
144 bool locked()
const {
return lockCnt > 0; }
149#if __cplusplus < 201101L
151 void operator =(
Lock const&);
154 void operator =(
Lock const&) =
delete;
158#if FREERTOSCPP_USE_NAMESPACE
Class to hold a block based lock.
Definition Lock.h:121
int lockCnt
The number of locks we hold on lockable.
Definition Lock.h:147
bool locked() const
Do we have the lock?
Definition Lock.h:144
Lock(Lock const &)=delete
We are not copyable.
Lock(Lockable &mylockable, TickType_t wait)
Constructor with assumed locking by specifying lock time.
Definition Lock.h:129
Lockable & lockable
The Lockage object we are connected to.
Definition Lock.h:146
A Base class to provide block based locking capability.
Definition Lock.h:58
virtual bool take(TickType_t wait=portMAX_DELAY)=0
Lockable()
Definition Lock.h:60
virtual ~Lockable()
Definition Lock.h:61
Lockable(Lockable const &)=delete
We are not copyable.
Definition FreeRTOScpp.h:74