#include <userver/concurrent/variable.hpp>
Container for shared data protected with a mutex of any type (mutex, shared mutex, etc.).
Definition at line 59 of file variable.hpp.
Public Member Functions | |
template<typename... Arg> | |
Variable (Arg &&... arg) | |
LockedPtr< std::unique_lock< Mutex >, Data > | UniqueLock () |
LockedPtr< std::unique_lock< Mutex >, const Data > | UniqueLock () const |
std::optional< LockedPtr< std::unique_lock< Mutex >, const Data > > | UniqueLock (std::try_to_lock_t) const |
std::optional< LockedPtr< std::unique_lock< Mutex >, Data > > | UniqueLock (std::try_to_lock_t) |
std::optional< LockedPtr< std::unique_lock< Mutex >, const Data > > | UniqueLock (std::chrono::milliseconds try_duration) const |
std::optional< LockedPtr< std::unique_lock< Mutex >, Data > > | UniqueLock (std::chrono::milliseconds try_duration) |
LockedPtr< std::shared_lock< Mutex >, const Data > | SharedLock () const |
LockedPtr< std::lock_guard< Mutex >, Data > | Lock () |
LockedPtr< std::lock_guard< Mutex >, const Data > | Lock () const |
Mutex & | GetMutexUnsafe () const |
Data & | GetDataUnsafe () |
const Data & | GetDataUnsafe () const |
|
inline |
Definition at line 62 of file variable.hpp.
|
inline |
Get raw data. Use with extreme caution, only for cases where it is impossible to access data with safe methods (e.g. std::scoped_lock with multiple mutexes). For simple use cases call Lock(), UniqueLock(), SharedLock() instead.
Definition at line 110 of file variable.hpp.
|
inline |
Definition at line 112 of file variable.hpp.
|
inline |
Get raw mutex. Use with caution. For simple use cases call Lock(), UniqueLock(), SharedLock() instead.
Definition at line 104 of file variable.hpp.
|
inline |
Definition at line 96 of file variable.hpp.
|
inline |
Definition at line 98 of file variable.hpp.
|
inline |
Definition at line 92 of file variable.hpp.
|
inline |
Definition at line 64 of file variable.hpp.
|
inline |
Definition at line 68 of file variable.hpp.
|
inline |
Definition at line 87 of file variable.hpp.
|
inline |
Definition at line 82 of file variable.hpp.
|
inline |
Definition at line 77 of file variable.hpp.
|
inline |
Definition at line 72 of file variable.hpp.