summaryrefslogtreecommitdiffstats
path: root/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/shared/platform/linux-sgx/sgx_pthread.h
blob: 01a3ae044315699f0d463861b8cc00d0a9dc1b47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright (C) 2019 Intel Corporation.  All rights reserved.
 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 */

#ifndef _SGX_PTHREAD_H
#define _SGX_PTHREAD_H

#ifdef __cplusplus
extern "C" {
#endif

#ifndef SGX_THREAD_LOCK_INITIALIZER /* defined since sgxsdk-2.11 */
/* sgxsdk doesn't support pthread_rwlock related APIs until
   version 2.11, we implement them by ourselves. */
typedef uintptr_t pthread_rwlock_t;

int
pthread_rwlock_init(pthread_rwlock_t *rwlock, void *attr);
int
pthread_rwlock_destroy(pthread_rwlock_t *rwlock);

int
pthread_rwlock_wrlock(pthread_rwlock_t *rwlock);
int
pthread_rwlock_rdlock(pthread_rwlock_t *rwlock);
int
pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
#endif /* end of SGX_THREAD_LOCK_INITIALIZER */

#ifdef __cplusplus
}
#endif

#endif /* end of _SGX_PTHREAD_H */