mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
f40ed36802
* fixed sem_init()
18 lines
291 B
C
18 lines
291 B
C
#ifndef SEMAPHORE_H
|
|
#define SEMAPHORE_H
|
|
|
|
#include <stdint.h>
|
|
#include <mutex.h>
|
|
|
|
typedef struct sem_t {
|
|
int8_t value;
|
|
int8_t locked;
|
|
mutex_t mutex;
|
|
} sem_t;
|
|
|
|
void sem_init(sem_t *sem, int8_t value);
|
|
int sem_wait(sem_t *sem);
|
|
int sem_signal(sem_t *sem);
|
|
|
|
#endif /* SEMAPHORE_H*/
|