9 #ifndef CPPCOMMON_THREADS_CRITICAL_SECTION_H
10 #define CPPCOMMON_THREADS_CRITICAL_SECTION_H
83 Impl& impl() noexcept {
return reinterpret_cast<Impl&
>(_storage); }
84 const Impl& impl() const noexcept {
return reinterpret_cast<Impl const&
>(_storage); }
86 static const size_t StorageSize = 64;
87 static const size_t StorageAlign = 8;
88 alignas(StorageAlign) std::byte _storage[StorageSize];
91 void* native() noexcept;
Condition variable synchronization primitive.
Critical section synchronization primitive.
CriticalSection & operator=(CriticalSection &&cs)=delete
bool TryLock()
Try to acquire critical section without block.
void Lock()
Acquire critical section with block.
bool TryLockUntil(const UtcTimestamp ×tamp)
Try to acquire critical section until the given timestamp.
bool TryLockFor(const Timespan ×pan)
Try to acquire critical section for the given timespan.
CriticalSection(const CriticalSection &)=delete
CriticalSection(CriticalSection &&cs)=delete
void Unlock()
Release critical section.
CriticalSection & operator=(const CriticalSection &)=delete
Locker synchronization primitive definition.
C++ Common project definitions.