Loading [MathJax]/extensions/tex2jax.js
CS350 COS
COS
All Data Structures Files Functions Variables Typedefs Macros
cv.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <sys/cdefs.h>
#include <sys/kassert.h>
#include <sys/kconfig.h>
#include <sys/kdebug.h>
#include <sys/kmem.h>
#include <sys/mp.h>
#include <sys/queue.h>
#include <sys/thread.h>
#include <sys/spinlock.h>
#include <sys/waitchannel.h>
#include <sys/mutex.h>
#include <sys/cv.h>
#include <errno.h>
Include dependency graph for cv.c:

Go to the source code of this file.

Functions

void CV_Init (CV *cv, const char *name)
 
void CV_Destroy (CV *cv)
 
void CV_Wait (CV *cv, Mutex *mtx)
 
void CV_Signal (CV *cv)
 
void CV_Broadcast (CV *cv)
 

Function Documentation

◆ CV_Broadcast()

void CV_Broadcast ( CV cv)

CV_Broadcast –

Wake all threads waiting on the condition.

Definition at line 70 of file cv.c.

71{
72 /* XXXFILLMEIN */
73}

◆ CV_Destroy()

void CV_Destroy ( CV cv)

Definition at line 33 of file cv.c.

34{
36
37 return;
38}
WaitChannel chan
Definition: cv.h:6
void WaitChannel_Destroy(WaitChannel *wc)
Definition: waitchannel.c:40
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CV_Init()

void CV_Init ( CV cv,
const char *  name 
)

Definition at line 25 of file cv.c.

26{
27 WaitChannel_Init(&cv->chan, name);
28
29 return;
30}
void WaitChannel_Init(WaitChannel *wc, const char *name)
Definition: waitchannel.c:28
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CV_Signal()

void CV_Signal ( CV cv)

CV_Signal –

Wake a single thread waiting on the condition.

Definition at line 59 of file cv.c.

60{
61 /* XXXFILLMEIN */
62}
Here is the caller graph for this function:

◆ CV_Wait()

void CV_Wait ( CV cv,
Mutex mtx 
)

CV_Wait –

Wait to be woken up on a condition.

Definition at line 46 of file cv.c.

47{
48 /* Do not go to sleep holding a spinlock! */
49 ASSERT(Critical_Level() == 0);
50 /* XXXFILLMEIN */
51}
uint32_t Critical_Level()
Definition: critical.c:45
#define ASSERT(_x)
Definition: kassert.h:8
Here is the call graph for this function: