Stroika Library 3.0d23
 
Loading...
Searching...
No Matches
Stroika::Foundation::Execution::VirtualLockable Class Reference

#include <VirtualLockable.h>

Static Public Member Functions

template<Common::StdCompat::Lockable REAL_MUTEX>
static VirtualLockable Make ()
 

Detailed Description

This class follows the Mutex concept and indirects to argument mutex impl.

Example Usage
// in class declaration where you sometimes want real locking, and somtimes just assert fake locking
mutable Execution::VirtualLockable fMaybeLock_; // either Debug::AssertExternallySyncrhonized or std::recursive_mutex
// in constructor, based on config parameter passed in
, fMaybeLock_{options.fInternallySyncrhonized == eInternallySynchronized ? VirtualLockable::Make<recursive_mutex> ()
: VirtualLockable::Make<Debug::AssertExternallySynchronizedMutex> ()}
// then use as regular mutex
scoped_lock critSec{fMaybeLock_};

Definition at line 36 of file VirtualLockable.h.

Member Function Documentation

◆ Make()

template<Common::StdCompat::Lockable REAL_MUTEX>
VirtualLockable Stroika::Foundation::Execution::VirtualLockable::Make ( )
static

Because we need a templated type for construction, and cannot template constructor called with explicit template arguments

Definition at line 13 of file VirtualLockable.inl.


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