sgx_pthread.h 825 B

12345678910111213141516171819202122232425262728293031
  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 pthread_rwlock_init(pthread_rwlock_t *rwlock, void *attr);
  15. int pthread_rwlock_destroy(pthread_rwlock_t *rwlock);
  16. int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock);
  17. int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock);
  18. int pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
  19. #endif /* end of SGX_THREAD_LOCK_INITIALIZER */
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif /* end of _SGX_PTHREAD_H */