kernel: Add posix API for semaphore
Add semaphore posix APIs. Signed-off-by: Punit Vara <punit.vara@intel.com>
This commit is contained in:
parent
b9588d8eb6
commit
a74725f1d3
7 changed files with 210 additions and 1 deletions
28
include/posix/semaphore.h
Normal file
28
include/posix/semaphore.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright (c) 2018 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef _POSIX_SEMAPHORE_H
|
||||
#define _POSIX_SEMAPHORE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "sys/types.h"
|
||||
#include <time.h>
|
||||
|
||||
int sem_destroy(sem_t *semaphore);
|
||||
int sem_getvalue(sem_t *semaphore, int *value);
|
||||
int sem_init(sem_t *semaphore, int pshared, unsigned int value);
|
||||
int sem_post(sem_t *semaphore);
|
||||
int sem_timedwait(sem_t *semaphore, struct timespec *abstime);
|
||||
int sem_trywait(sem_t *semaphore);
|
||||
int sem_wait(sem_t *semaphore);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* POSIX_SEMAPHORE_H */
|
Loading…
Add table
Add a link
Reference in a new issue