#include <userver/concurrent/mutex_set.hpp>
Mutex-like object associated with the key of a MutexSet. It provides the same interface as engine::Mutex, you may use it with std::unique_lock, std::lock_guard, etc.
Definition at line 46 of file mutex_set.hpp.
Public Types | |
using | HashAndKey = utils::CachedHash<Key> |
using | MutexDatum = impl::MutexDatum<HashAndKey, utils::CachedHashKeyEqual<Equal>> |
Public Member Functions | |
ItemMutex (MutexDatum &md, HashAndKey &&key) | |
void | lock () |
void | unlock () |
bool | try_lock () |
template<typename Rep , typename Period > | |
bool | try_lock_for (std::chrono::duration< Rep, Period >) |
template<typename Clock , typename Duration > | |
bool | try_lock_until (std::chrono::time_point< Clock, Duration >) |
using concurrent::ItemMutex< Key, Equal >::HashAndKey = utils::CachedHash<Key> |
Definition at line 48 of file mutex_set.hpp.
using concurrent::ItemMutex< Key, Equal >::MutexDatum = impl::MutexDatum<HashAndKey, utils::CachedHashKeyEqual<Equal>> |
Definition at line 50 of file mutex_set.hpp.
concurrent::ItemMutex< Key, Equal >::ItemMutex | ( | MutexDatum & | md, |
HashAndKey && | key ) |
Definition at line 115 of file mutex_set.hpp.
void concurrent::ItemMutex< Key, Equal >::lock | ( | ) |
Definition at line 118 of file mutex_set.hpp.
bool concurrent::ItemMutex< Key, Equal >::try_lock | ( | ) |
Definition at line 151 of file mutex_set.hpp.
bool concurrent::ItemMutex< Key, Equal >::try_lock_for | ( | std::chrono::duration< Rep, Period > | duration | ) |
Definition at line 158 of file mutex_set.hpp.
bool concurrent::ItemMutex< Key, Equal >::try_lock_until | ( | std::chrono::time_point< Clock, Duration > | time_point | ) |
Definition at line 165 of file mutex_set.hpp.
void concurrent::ItemMutex< Key, Equal >::unlock | ( | ) |
Definition at line 127 of file mutex_set.hpp.