semaphore.h 639 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _WAMR_LIB_SEMAPHORE_H
  6. #define _WAMR_LIB_SEMAPHORE_H
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #include <stdint.h>
  11. typedef unsigned int sem_t;
  12. /* Semaphore APIs */
  13. sem_t *
  14. sem_open(const char *name, int oflag, int mode, int val);
  15. int
  16. sem_wait(sem_t *sem);
  17. int
  18. sem_trywait(sem_t *sem);
  19. int
  20. sem_post(sem_t *sem);
  21. int
  22. sem_getvalue(sem_t *restrict sem, int *sval);
  23. int
  24. sem_unlink(const char *name);
  25. int
  26. sem_close(sem_t *sem);
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #endif /* end of _WAMR_LIB_SEMAPHORE_H */