added primitive semaphore
This commit is contained in:
12
semaphore.h
Normal file
12
semaphore.h
Normal 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);
|
||||
Reference in New Issue
Block a user