libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
|
A class to control access to resource, possibly using the stack, using the RAII idiom. More...
#include <locking.hpp>
Public Types | |
typedef scope_lock< LockObject > | base_t |
typedef base_t::atomic_t | atomic_t |
typedef atomic_t::lock_traits | lock_traits |
typedef lock_traits::atomic_state_type | atomic_state_type |
typedef lock_traits::timeout_type | timeout_type |
typedef atomic_state_type | lock_result_type |
![]() | |
typedef lockable< typename LockObject::lock_traits > | base_t |
typedef LockObject | atomic_t |
typedef atomic_t::lock_traits | lock_traits |
typedef lock_traits::atomic_state_type | atomic_state_type |
typedef lock_traits::timeout_type | timeout_type |
typedef atomic_state_type | lock_result_type |
![]() | |
using | lock_traits = LockObject::lock_traits |
typedef lock_traits::atomic_state_type | atomic_state_type |
typedef lock_traits::timeout_type | timeout_type |
Public Member Functions | |
__stdcall | in_process (atomic_t &lo, const timeout_type period=lock_traits::infinite_timeout()) noexcept(true) FORCE_INLINE |
Get control of the lock for the resource. More... | |
__stdcall | ~in_process () noexcept(true) FORCE_INLINE |
Release the lock on the resource. More... | |
void | decay () noexcept(true) FORCE_INLINE |
Protected Member Functions | |
lock_result_type __fastcall | try_lock () noexcept(true) override FORCE_INLINE |
lock_result_type __fastcall | lock () noexcept(false) override FORCE_INLINE |
lock_result_type __fastcall | lock (const timeout_type period) noexcept(false) override FORCE_INLINE |
lock_result_type __fastcall | unlock () noexcept(true) override FORCE_INLINE |
![]() | |
__stdcall | scope_lock (atomic_t &lo) noexcept(true) FORCE_INLINE |
__stdcall | scope_lock (atomic_t &lo, const timeout_type period) noexcept(true) FORCE_INLINE |
scope_lock (scope_lock const &)=delete | |
virtual __stdcall | ~scope_lock () noexcept(true) FORCE_INLINE |
void | decay () noexcept(true) FORCE_INLINE |
Additional Inherited Members | |
![]() | |
static constexpr generic_traits::memory_access_modes | memory_access_mode =atomic_t::memory_access_mode |
![]() | |
atomic_t & | locker |
A class to control access to resource, possibly using the stack, using the RAII idiom.
Use this lock for multiple threads in the same process space. Class to manipulate an in-process lock on the stack, with locking on construction, release on destruction. (The "LockObject &" will be valid.)
Definition at line 125 of file locking.hpp.
typedef lock_traits::atomic_state_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::lock::in_process< LockObject >::atomic_state_type |
Definition at line 130 of file locking.hpp.
typedef base_t::atomic_t jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::lock::in_process< LockObject >::atomic_t |
Definition at line 128 of file locking.hpp.
typedef scope_lock<LockObject> jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::lock::in_process< LockObject >::base_t |
Definition at line 127 of file locking.hpp.
typedef atomic_state_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::lock::in_process< LockObject >::lock_result_type |
Definition at line 132 of file locking.hpp.
typedef atomic_t::lock_traits jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::lock::in_process< LockObject >::lock_traits |
Definition at line 129 of file locking.hpp.
typedef lock_traits::timeout_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::lock::in_process< LockObject >::timeout_type |
Definition at line 131 of file locking.hpp.
|
inlineexplicitnoexcept |
Get control of the lock for the resource.
Note that this may lock the resource.
lo | The lock for the resource. |
period | The period that should be waited for attempting to gain the lock on the resource. |
Definition at line 97 of file locking_impl.hpp.
|
inlinenoexcept |
Release the lock on the resource.
Definition at line 102 of file locking_impl.hpp.
|
inlinenoexcept |
Definition at line 130 of file locking_impl.hpp.
|
inlineoverrideprotectedvirtualnoexcept |
Reimplemented from jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::lock::scope_lock< LockObject >.
Definition at line 112 of file locking_impl.hpp.
|
inlineoverrideprotectedvirtualnoexcept |
period | The period that should be waited for attempting to gain the lock on the resource. |
Reimplemented from jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::lock::scope_lock< LockObject >.
Definition at line 118 of file locking_impl.hpp.
|
inlineoverrideprotectedvirtualnoexcept |
Reimplemented from jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::lock::scope_lock< LockObject >.
Definition at line 106 of file locking_impl.hpp.
|
inlineoverrideprotectedvirtualnoexcept |
Reimplemented from jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::lock::scope_lock< LockObject >.
Definition at line 124 of file locking_impl.hpp.