sem.h

Go to the documentation of this file.
00001 
00043 #ifndef KERN_SEM_H
00044 #define KERN_SEM_H
00045 
00046 #include <cfg/compiler.h>
00047 #include <mware/list.h>
00048 
00049 /* Fwd decl */
00050 struct Process;
00051 
00052 
00053 typedef struct Semaphore
00054 {
00055     struct Process *owner;
00056     List            wait_queue;
00057     int             nest_count;
00058 } Semaphore;
00059 
00064 void sem_init(struct Semaphore *s);
00065 bool sem_attempt(struct Semaphore *s);
00066 void sem_obtain(struct Semaphore *s);
00067 void sem_release(struct Semaphore *s);
00068 /* \} */
00069 
00070 #endif /* KERN_SEM_H */