BeRTOS
|
00001 00049 #ifndef KERN_SEM_H 00050 #define KERN_SEM_H 00051 00052 #include <cfg/compiler.h> 00053 #include <struct/list.h> 00054 00055 /* Fwd decl */ 00056 struct Process; 00057 00058 00059 typedef struct Semaphore 00060 { 00061 struct Process *owner; 00062 List wait_queue; 00063 int nest_count; 00064 } Semaphore; 00065 00070 void sem_init(struct Semaphore *s); 00071 bool sem_attempt(struct Semaphore *s); 00072 void sem_obtain(struct Semaphore *s); 00073 void sem_release(struct Semaphore *s); 00074 /* \} */ 00075 /* \} */ //defgroup kern_sem 00076 00077 int sem_testRun(void); 00078 int sem_testSetup(void); 00079 int sem_testTearDown(void); 00080 00081 #endif /* KERN_SEM_H */