19 #ifndef GRPC_CORE_LIB_GPRPP_SYNC_H
20 #define GRPC_CORE_LIB_GPRPP_SYNC_H
94 bool released_ =
false;
113 template <
typename Predicate>
void WaitUntil(Mutex *mu, Predicate pred)
Definition: sync.h:114
CondVar(const CondVar &)=delete
void Signal()
Definition: sync.h:105
CondVar & operator=(const CondVar &)=delete
int Wait(Mutex *mu)
Definition: sync.h:108
CondVar()
Definition: sync.h:99
int Wait(Mutex *mu, const gpr_timespec &deadline)
Definition: sync.h:109
void Broadcast()
Definition: sync.h:106
~CondVar()
Definition: sync.h:100
const gpr_mu * get() const
Definition: sync.h:49
~Mutex()
Definition: sync.h:43
Mutex()
Definition: sync.h:42
gpr_mu * get()
Definition: sync.h:48
Mutex(const Mutex &)=delete
Mutex & operator=(const Mutex &)=delete
MutexLock(Mutex *mu)
Definition: sync.h:58
MutexLock & operator=(const MutexLock &)=delete
MutexLock(const MutexLock &)=delete
~MutexLock()
Definition: sync.h:60
MutexLock(gpr_mu *mu)
Definition: sync.h:59
ReleasableMutexLock & operator=(const ReleasableMutexLock &)=delete
void Lock()
Definition: sync.h:80
ReleasableMutexLock(Mutex *mu)
Definition: sync.h:71
ReleasableMutexLock(gpr_mu *mu)
Definition: sync.h:72
~ReleasableMutexLock()
Definition: sync.h:73
void Unlock()
Definition: sync.h:86
ReleasableMutexLock(const ReleasableMutexLock &)=delete
@ GPR_CLOCK_REALTIME
Realtime clock.
Definition: gpr_types.h:36
GPRAPI gpr_timespec gpr_inf_future(gpr_clock_type type)
The zero time interval.
#define GPR_DEBUG_ASSERT(x)
Definition: log.h:103
pthread_cond_t gpr_cv
Definition: sync_posix.h:46
GPRAPI void gpr_cv_destroy(gpr_cv *cv)
Cause *cv no longer to be initialized, freeing any memory in use.
GPRAPI void gpr_cv_init(gpr_cv *cv)
— Condition variable interface —
GPRAPI void gpr_mu_destroy(gpr_mu *mu)
Cause *mu no longer to be initialized, freeing any memory in use.
GPRAPI void gpr_cv_broadcast(gpr_cv *cv)
Wake all threads waiting on *cv.
GPRAPI void gpr_mu_lock(gpr_mu *mu)
Wait until no thread has a lock on *mu, cause the calling thread to own an exclusive lock on *mu,...
GPRAPI void gpr_mu_init(gpr_mu *mu)
— Mutex interface —
GPRAPI void gpr_cv_signal(gpr_cv *cv)
If any threads are waiting on *cv, wake at least one.
GPRAPI int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline)
Atomically release *mu and wait on *cv.
GPRAPI void gpr_mu_unlock(gpr_mu *mu)
Release an exclusive lock on *mu held by the calling thread.
Internal thread interface.
Definition: backoff.h:26
Definition: sync_windows.h:26
Analogous to struct timespec.
Definition: gpr_types.h:47