Skip to main content
Pigweed's logo Pigweed
  1. Home
  2. Reference
  3. C/C++
  4. pw::sync::SharedLockable< LockT > Class Template Reference
Loading...
Searching...
No Matches
pw::sync::SharedLockable< LockT > Class Template Referencefinal

Overview

template<typename LockT>
class pw::sync::SharedLockable< LockT >

SharedLockable provides a VirtualBasicLockable API which exercises the parent SharedMutex reader API.

A single SharedLockable may be shared across threads, but a thread must not recursively call lock() or unlock(). Doing so is undefined behavior.

Inheritance diagram for pw::sync::SharedLockable< LockT >:
pw::sync::VirtualBasicLockable

Public Member Functions

 SharedLockable (LockT *parent)
 
 SharedLockable (const SharedLockable &)=delete
 
 SharedLockable (SharedLockable &&)=delete
 
SharedLockable & operator= (const SharedLockable &)=delete
 
SharedLockable & operator= (SharedLockable &&)=delete
 
- Public Member Functions inherited from pw::sync::VirtualBasicLockable
void lock ()
 
void unlock ()
 

Private Member Functions

void DoLockOperation (Operation operation) final
 

Additional Inherited Members

- Protected Types inherited from pw::sync::VirtualBasicLockable
enum class  Operation { kLock , kUnlock }
 

Member Function Documentation

◆ DoLockOperation()

template<typename LockT >
void pw::sync::SharedLockable< LockT >::DoLockOperation ( Operation  operation)
inlinefinalprivatevirtual

Uses a single virtual method with an enum to minimize the vtable cost per implementation of VirtualBasicLockable.

Implements pw::sync::VirtualBasicLockable.


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