FreeRTOS Addons
|
#include <read_write_lock.hpp>
Public Member Functions | |
ReadWriteLock () | |
virtual | ~ReadWriteLock () |
virtual void | ReaderLock ()=0 |
virtual void | ReaderUnlock ()=0 |
virtual void | WriterLock ()=0 |
virtual void | WriterUnlock ()=0 |
Protected Attributes | |
int | ReadCount |
SemaphoreHandle_t | ReadLock |
SemaphoreHandle_t | ResourceLock |
Abstract base class encapsulating a Reader/Writer lock.
These locks are based on mutexs and cannot be used in any way from ISR context. Likewise, these locks block indefinitely.
ReadWriteLock::ReadWriteLock | ( | ) |
Constructor
ReadWriteLockCreateException | on failure. |
|
virtual |
Destructor
|
pure virtual |
Take the lock as a Reader. This allows multiple reader access.
Implemented in cpp_freertos::ReadWriteLockPreferReader, and cpp_freertos::ReadWriteLockPreferWriter.
|
pure virtual |
Unlock the Reader.
Implemented in cpp_freertos::ReadWriteLockPreferReader, and cpp_freertos::ReadWriteLockPreferWriter.
|
pure virtual |
Take the lock as a Writer. This allows only one thread access.
Implemented in cpp_freertos::ReadWriteLockPreferReader, and cpp_freertos::ReadWriteLockPreferWriter.
|
pure virtual |
Unlock the Writer.
Implemented in cpp_freertos::ReadWriteLockPreferReader, and cpp_freertos::ReadWriteLockPreferWriter.
|
protected |
How many active readers are there.
|
protected |
Protect ReadCount.
|
protected |
Protect this resource from multiple writer access, or from Reader access when a writer is changing something.