semaphore.h 687 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2018 Intel Corporation
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef ZEPHYR_INCLUDE_POSIX_SEMAPHORE_H_
  7. #define ZEPHYR_INCLUDE_POSIX_SEMAPHORE_H_
  8. #include <posix/time.h>
  9. #include "posix_types.h"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. int sem_destroy(sem_t *semaphore);
  14. int sem_getvalue(sem_t *restrict semaphore, int *restrict value);
  15. int sem_init(sem_t *semaphore, int pshared, unsigned int value);
  16. int sem_post(sem_t *semaphore);
  17. int sem_timedwait(sem_t *restrict semaphore, struct timespec *restrict abstime);
  18. int sem_trywait(sem_t *semaphore);
  19. int sem_wait(sem_t *semaphore);
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif /* ZEPHYR_INCLUDE_POSIX_SEMAPHORE_H_ */