68 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_LIBC_MACROS_PTHREAD_MACRO_H10#define LLVM_LIBC_MACROS_PTHREAD_MACRO_H11 12#include "null-macro.h"13 14#define PTHREAD_CREATE_JOINABLE 015#define PTHREAD_CREATE_DETACHED 116 17#define PTHREAD_MUTEX_NORMAL 018#define PTHREAD_MUTEX_ERRORCHECK 119#define PTHREAD_MUTEX_RECURSIVE 220#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL21 22#define PTHREAD_MUTEX_STALLED 023#define PTHREAD_MUTEX_ROBUST 124 25#define PTHREAD_BARRIER_SERIAL_THREAD -126 27#define PTHREAD_ONCE_INIT {0}28 29#define PTHREAD_PROCESS_PRIVATE 030#define PTHREAD_PROCESS_SHARED 131 32#ifdef __linux__33#define PTHREAD_MUTEX_INITIALIZER \34 { \35 /* .__timed = */ 0, /* .__recursive = */ 0, \36 /* .__robust = */ 0, /* .__owner = */ NULL, \37 /* .__lock_count = */ 0, /* .__futex_word = */ {0}, \38 }39#else40#define PTHREAD_MUTEX_INITIALIZER \41 { \42 /* .__timed = */ 0, /* .__recursive = */ 0, \43 /* .__robust = */ 0, /* .__owner = */ NULL, \44 /* .__lock_count = */ 0, \45 }46#endif47 48#define PTHREAD_RWLOCK_INITIALIZER \49 { \50 /* .__is_pshared = */ 0, \51 /* .__preference = */ 0, \52 /* .__state = */ 0, \53 /* .__write_tid = */ 0, \54 /* .__wait_queue_mutex = */ {0}, \55 /* .__pending_readers = */ {0}, \56 /* .__pending_writers = */ {0}, \57 /* .__reader_serialization = */ {0}, \58 /* .__writer_serialization = */ {0}, \59 }60 61// glibc extensions62#define PTHREAD_STACK_MIN (1 << 14) // 16KB63#define PTHREAD_RWLOCK_PREFER_READER_NP 064#define PTHREAD_RWLOCK_PREFER_WRITER_NP 165#define PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP 266 67#endif // LLVM_LIBC_MACROS_PTHREAD_MACRO_H68