| 
    CS350 COS
    
   COS 
   | 
 
#include <stdbool.h>#include <stdint.h>#include <string.h>#include <sys/cdefs.h>#include <sys/kassert.h>#include <sys/kdebug.h>#include <sys/queue.h>#include <sys/thread.h>#include <sys/spinlock.h>#include <sys/waitchannel.h>Go to the source code of this file.
Functions | |
| LIST_HEAD (ChanListHead, WaitChannel) | |
| void | WaitChannel_Init (WaitChannel *wchan, const char *name) | 
| void | WaitChannel_Destroy (WaitChannel *wchan) | 
| void | WaitChannel_Lock (WaitChannel *wchan) | 
| void | WaitChannel_Sleep (WaitChannel *wchan) | 
| void | WaitChannel_Wake (WaitChannel *wchan) | 
| void | WaitChannel_WakeAll (WaitChannel *wchan) | 
Variables | |
| Spinlock | chanListLock | 
| LIST_HEAD | ( | ChanListHead | , | 
| WaitChannel | |||
| ) | 
Definition at line 19 of file waitchannel.c.
| void WaitChannel_Destroy | ( | WaitChannel * | wchan | ) | 
Definition at line 40 of file waitchannel.c.
| void WaitChannel_Init | ( | WaitChannel * | wchan, | 
| const char * | name | ||
| ) | 
Definition at line 28 of file waitchannel.c.
| void WaitChannel_Lock | ( | WaitChannel * | wchan | ) | 
WaitChannel_Lock –
Acquires the wait channel lock.
Definition at line 57 of file waitchannel.c.
| void WaitChannel_Sleep | ( | WaitChannel * | wchan | ) | 
WaitChannel_Sleep –
Places the current thread to asleep while releasing the wait channel lock.
Side Effect: Retains a reference to thread until the thread is woken up.
Definition at line 71 of file waitchannel.c.
| void WaitChannel_Wake | ( | WaitChannel * | wchan | ) | 
WaitChannel_Wake –
Wake up a single thread.
Side Effects: Releases the thread reference once complete.
Definition at line 91 of file waitchannel.c.
| void WaitChannel_WakeAll | ( | WaitChannel * | wchan | ) | 
WaitChannel_WakeAll –
Wakes up all threads currently sleeping on the wait channel.
Side Effects: Releases all thread references.
Definition at line 116 of file waitchannel.c.
| Spinlock chanListLock | 
Definition at line 18 of file waitchannel.c.