Loading...
Searching...
No Matches

Condition variable for thread synchronization. More...

Detailed Description

Condition variable for thread synchronization.

Author
Sam Kumar samku.nosp@m.mar@.nosp@m.berke.nosp@m.ley..nosp@m.edu

Definition in file cond.h.

#include <stdbool.h>
#include <stddef.h>
#include "list.h"
#include "mutex.h"
+ Include dependency graph for cond.h:

Go to the source code of this file.

Data Structures

struct  cond_t
 Condition variable structure. More...
 

Macros

#define COND_INIT   { { NULL } }
 Static initializer for cond_t.
 

Functions

void cond_init (cond_t *cond)
 Initializes a condition variable.
 
void cond_wait (cond_t *cond, mutex_t *mutex)
 Waits on a condition.
 
void cond_signal (cond_t *cond)
 Wakes up one thread waiting on the condition variable.
 
void cond_broadcast (cond_t *cond)
 Wakes up all threads waiting on the condition variable.