2018-02-06 11:57:44 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
#ifndef _POSIX_SEMAPHORE_H
|
|
|
|
#define _POSIX_SEMAPHORE_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-04-06 01:11:15 +08:00
|
|
|
#include <posix/time.h>
|
2018-02-06 11:57:44 +08:00
|
|
|
#include "sys/types.h"
|
|
|
|
|
|
|
|
int sem_destroy(sem_t *semaphore);
|
2018-03-16 14:35:27 +08:00
|
|
|
int sem_getvalue(sem_t *restrict semaphore, int *restrict value);
|
2018-02-06 11:57:44 +08:00
|
|
|
int sem_init(sem_t *semaphore, int pshared, unsigned int value);
|
|
|
|
int sem_post(sem_t *semaphore);
|
2018-03-16 14:35:27 +08:00
|
|
|
int sem_timedwait(sem_t *restrict semaphore, struct timespec *restrict abstime);
|
2018-02-06 11:57:44 +08:00
|
|
|
int sem_trywait(sem_t *semaphore);
|
|
|
|
int sem_wait(sem_t *semaphore);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* POSIX_SEMAPHORE_H */
|