9#ifndef THREAD_BOOST_PRIMITIVES_H_
10#define THREAD_BOOST_PRIMITIVES_H_
14#include "absl/base/thread_annotations.h"
15#include "absl/time/time.h"
25class ABSL_LOCKABLE Mutex {
32 void Lock() noexcept ABSL_EXCLUSIVE_LOCK_FUNCTION();
33 void Unlock() noexcept ABSL_UNLOCK_FUNCTION();
35 void lock() noexcept ABSL_EXCLUSIVE_LOCK_FUNCTION() { Lock(); }
37 void unlock() noexcept ABSL_UNLOCK_FUNCTION() { Unlock(); }
42 static constexpr std::size_t kImplSize = 64;
43 alignas(std::max_align_t) std::byte impl_[kImplSize];
47class ABSL_SCOPED_LOCKABLE MutexLock {
80 static constexpr
std::
size_t kImplSize = 64;
81 alignas(
std::max_align_t)
std::
byte impl_[kImplSize];
85void SleepFor(absl::Duration duration);
Definition boost_primitives.h:110
CondVar(const CondVar &)=delete
void Wait(Mutex *mu) noexcept
void SignalAll() noexcept
Definition boost_primitives.h:230
bool WaitWithDeadline(Mutex *mu, absl::Time deadline) noexcept
~CondVar()
Definition boost_primitives.cc:61
CondVar & operator=(const CondVar &)=delete
bool WaitWithTimeout(Mutex *mu, absl::Duration timeout) noexcept
Definition boost_primitives.h:95
~MutexLock() ABSL_UNLOCK_FUNCTION()
Definition boost_primitives.h:56
MutexLock(Mutex *mu) ABSL_EXCLUSIVE_LOCK_FUNCTION(mu)
Definition boost_primitives.h:49
MutexLock(const MutexLock &)=delete
MutexLock & operator=(const MutexLock &)=delete
Definition boost_primitives.h:34
void Lock() noexcept ABSL_EXCLUSIVE_LOCK_FUNCTION()
Mutex & operator=(const Mutex &)=delete
void unlock() noexcept ABSL_UNLOCK_FUNCTION()
Definition boost_primitives.h:37
Mutex(const Mutex &)=delete
Definition exception_count.cc:8
void SleepFor(absl::Duration duration)
Definition boost_primitives.h:263
constexpr bool kCanParkAwait
Definition boost_primitives.h:28
bool CanParkAwait() noexcept
Definition boost_primitives.h:30
Definition boost_primitives.cc:50