scheduler.c

Basic task scheduling library
git clone git://git.finwo.net/lib/scheduler.c
Log | Files | Refs | README | LICENSE

sched-sem.c (279B)


      1 #include "sched-sem.h"
      2 
      3 void sched_sem_init(struct sched_sem *sem, int amount) {
      4   sem->value = amount;
      5 }
      6 
      7 void sched_sem_signal(struct sched_sem *sem, int amount) {
      8   sem->value += amount;
      9 }
     10 
     11 void sched_sem_consume(struct sched_sem *sem, int amount) {
     12   sem->value -= amount;
     13 }