ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
cond.h File Reference

Cross-platform condition variable interface for ascii-chat. More...

Go to the source code of this file.

Data Structures

struct  cond_t
 Condition variable type (POSIX: pthread_cond_t with debug tracking) More...
 

Macros

#define LOG_COND_STATE(cond)   cond_log_state(cond, __FILE__, __LINE__, __func__)
 
Condition Variable Wait Macros
#define cond_wait(cond, mutex)
 Wait on a condition variable (with debug tracking in debug builds)
 
#define cond_timedwait(cond, mutex, timeout_ns)
 Wait on a condition variable with timeout (with debug tracking in debug builds)
 

Functions

int cond_init (cond_t *cond, const char *name)
 Initialize a condition variable with a name.
 
int cond_destroy (cond_t *cond)
 Destroy a condition variable.
 
int cond_wait_impl (cond_t *cond, mutex_t *mutex)
 Wait on a condition variable (blocking) - implementation function.
 
int cond_timedwait_impl (cond_t *cond, mutex_t *mutex, uint64_t timeout_ns)
 Wait on a condition variable with timeout - implementation function.
 
int cond_signal (cond_t *cond)
 Signal a condition variable (wake one waiting thread)
 
int cond_broadcast (cond_t *cond)
 Broadcast to a condition variable (wake all waiting threads)
 
void cond_on_wait (cond_t *cond, mutex_t *mutex, const char *file, int line, const char *func)
 Hook called when a thread waits on a condition variable.
 
int debug_sync_cond_wait (cond_t *cond, mutex_t *mutex, const char *file, int line, const char *func)
 
int debug_sync_cond_timedwait (cond_t *cond, mutex_t *mutex, uint64_t timeout_ns, const char *file, int line, const char *func)
 
bool debug_sync_is_initialized (void)
 
void cond_on_signal (cond_t *cond)
 Hook called when a condition variable is signaled.
 
void cond_on_broadcast (cond_t *cond)
 Hook called when a condition variable is broadcast.
 
void cond_log_state (const cond_t *cond, const char *file, int line, const char *func)
 Log the state of a condition variable.
 

Detailed Description

Cross-platform condition variable interface for ascii-chat.

Definition in file cond.h.