vbos/include/lib/sem.h
Michael Shaw 2076f1dae1
lock: merge spinlock and mtx locks into one
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
2026-08-13 14:19:10 -04:00

17 lines
308 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _SEM_H_
#define _SEM_H_
#include <kernel/lock.h>
typedef struct _sem_t {
u64 sem;
lock_t lock;
} sem_t;
bool sem_trywait(sem_t *sem);
void sem_wait(sem_t *sem);
void sem_post(sem_t *sem);
void sem_init(sem_t *sem, size_t n_res);
#endif /* _SEM_H_ */