Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. pw_sync
  5. pw::sync::VirtualBasicLockable Class Reference
Loading...
Searching...
No Matches
pw::sync::VirtualBasicLockable Class Referenceabstract

Overview

The VirtualBasicLockable is a virtual lock abstraction for locks which meet the C++ named BasicLockable requirements of lock() and unlock().

This virtual indirection is useful in case you need configurable lock selection in a portable module where the final type is not defined upstream and ergo module configuration cannot be used or in case the lock type is not fixed at compile time, for example to support run time and crash time use of an object without incurring the code size hit for templating the object.

Inheritance diagram for pw::sync::VirtualBasicLockable:
pw::sync::GenericBasicLockable< InterruptSpinLock > pw::sync::GenericBasicLockable< Mutex > pw::sync::GenericBasicLockable< TimedMutex > pw::sync::ExclusiveLockable< LockT > pw::sync::GenericBasicLockable< LockType > pw::sync::NoOpLock pw::sync::SharedLockable< LockT > pw::sync::GenericLockable< InterruptSpinLock > pw::sync::GenericLockable< Mutex > pw::sync::GenericLockable< TimedMutex > pw::sync::GenericLockable< LockType > pw::sync::VirtualInterruptSpinLock pw::sync::VirtualMutex pw::sync::VirtualTimedMutex

Public Member Functions

void lock ()
 
void unlock ()
 

Protected Types

enum class  Operation { kLock , kUnlock }
 

Private Member Functions

virtual void DoLockOperation (Operation operation)=0
 

Member Function Documentation

◆ DoLockOperation()

virtual void pw::sync::VirtualBasicLockable::DoLockOperation ( Operation  operation)
privatepure virtual

◆ lock()

void pw::sync::VirtualBasicLockable::lock ( )
inline

Lock the underlying BasicLockable object.

thread safeyes isr safeno nmi safeno

◆ unlock()

void pw::sync::VirtualBasicLockable::unlock ( )
inline

Unlock the underlying BasicLockable object.

thread safeyes isr safeno nmi safeno


The documentation for this class was generated from the following file: