Skip to content

semaphore

include/sync/semaphore.h View source View on GitHub
struct semaphore (4 fields) source
§ int32_t count
§ bool irq_disable
§ struct spinlock lock
§ struct condvar cv
void semaphore_init(struct semaphore *s, int value, bool irq_disable)
source
void semaphore_post(struct semaphore *s)
source
void semaphore_postn(struct semaphore *s, int n)
source
#define SEMAPHORE_INIT_IRQ_DISABLE true
source

These are for the underlying spinlock

#define SEMAPHORE_INIT_NORMAL false
source