added primitive semaphore

This commit is contained in:
2022-08-30 16:26:29 +02:00
parent f5d433f177
commit 4c67d0bba4
2 changed files with 35 additions and 0 deletions

12
semaphore.h Normal file
View File

@@ -0,0 +1,12 @@
/*
* Copyright 2022 Oleg Borodin <borodin@unix7.org>
*/
typedef struct {
int value;
} sem_t;
int sem_init(sem_t* sem, int value);
int sem_wait(sem_t* sem);
int sem_post(sem_t* sem);