9 #ifndef CPPCOMMON_THREADS_MUTEX_H
10 #define CPPCOMMON_THREADS_MUTEX_H
81 Impl& impl() noexcept {
return reinterpret_cast<Impl&
>(_storage); }
82 const Impl& impl() const noexcept {
return reinterpret_cast<Impl const&
>(_storage); }
84 static const size_t StorageSize = 64;
85 static const size_t StorageAlign = 8;
86 alignas(StorageAlign) std::byte _storage[StorageSize];
Mutex synchronization primitive.
Mutex(const Mutex &)=delete
Mutex(Mutex &&mutex)=delete
Mutex & operator=(const Mutex &)=delete
bool TryLockUntil(const UtcTimestamp ×tamp)
Try to acquire mutex until the given timestamp.
bool TryLock()
Try to acquire mutex without block.
void Lock()
Acquire mutex with block.
void Unlock()
Release mutex.
Mutex & operator=(Mutex &&mutex)=delete
bool TryLockFor(const Timespan ×pan)
Try to acquire mutex for the given timespan.
Locker synchronization primitive definition.
C++ Common project definitions.