sgx_pthread.h 824 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _SGX_PTHREAD_H
  6. #define _SGX_PTHREAD_H
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #ifndef SGX_THREAD_LOCK_INITIALIZER /* defined since sgxsdk-2.11 */
  11. /* sgxsdk doesn't support pthread_rwlock related APIs until
  12. version 2.11, we implement them by ourselves. */
  13. typedef uintptr_t pthread_rwlock_t;
  14. int
  15. pthread_rwlock_init(pthread_rwlock_t *rwlock, void *attr);
  16. int
  17. pthread_rwlock_destroy(pthread_rwlock_t *rwlock);
  18. int
  19. pthread_rwlock_wrlock(pthread_rwlock_t *rwlock);
  20. int
  21. pthread_rwlock_rdlock(pthread_rwlock_t *rwlock);
  22. int
  23. pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
  24. #endif /* end of SGX_THREAD_LOCK_INITIALIZER */
  25. #ifdef __cplusplus
  26. }
  27. #endif
  28. #endif /* end of _SGX_PTHREAD_H */