xref: /llvm-project/libc/include/llvm-libc-macros/pthread-macros.h (revision 8a25398615e4ad434231edba234db95d111bb6cf)
1 //===-- Definition of pthread macros --------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIBC_MACROS_PTHREAD_MACRO_H
10 #define LLVM_LIBC_MACROS_PTHREAD_MACRO_H
11 
12 #define PTHREAD_CREATE_JOINABLE 0
13 #define PTHREAD_CREATE_DETACHED 1
14 
15 #define PTHREAD_MUTEX_NORMAL 0
16 #define PTHREAD_MUTEX_ERRORCHECK 1
17 #define PTHREAD_MUTEX_RECURSIVE 2
18 #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
19 
20 #define PTHREAD_MUTEX_STALLED 0
21 #define PTHREAD_MUTEX_ROBUST 1
22 
23 #define PTHREAD_ONCE_INIT {0}
24 
25 #define PTHREAD_PROCESS_PRIVATE 0
26 #define PTHREAD_PROCESS_SHARED 1
27 
28 #define PTHREAD_MUTEX_INITIALIZER {0}
29 #define PTHREAD_RWLOCK_INITIALIZER {0}
30 
31 // glibc extensions
32 #define PTHREAD_STACK_MIN (1 << 14) // 16KB
33 #define PTHREAD_RWLOCK_PREFER_READER_NP 0
34 #define PTHREAD_RWLOCK_PREFER_WRITER_NP 1
35 #define PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP 2
36 
37 #endif // LLVM_LIBC_MACROS_PTHREAD_MACRO_H
38