/** * \file * * * \defgroup kern_sem Mutually exclusive semaphores * \ingroup kern * \{ * \brief Mutually exclusive semaphores. * Shared locking not supported in this implementation. * * * \author Bernie Innocenti * * $WIZ$ module_name = "semaphores" * $WIZ$ module_depends = "kernel" * $WIZ$ module_configuration = "bertos/cfg/cfg_sem.h" */ #ifndef KERN_SEM_H #define KERN_SEM_H #include #include /* Fwd decl */ struct Process; typedef struct Semaphore { struct Process *owner; List wait_queue; int nest_count; } Semaphore; /** * \name Process synchronization services * \{ */ void sem_init(struct Semaphore *s); bool sem_attempt(struct Semaphore *s); void sem_obtain(struct Semaphore *s); void sem_release(struct Semaphore *s); /* \} */ /* \} */ //defgroup kern_sem int sem_testRun(void); int sem_testSetup(void); int sem_testTearDown(void); #endif /* KERN_SEM_H */