Path: blob/main/system/lib/llvm-libc/include/llvm-libc-macros/pthread-macros.h
6172 views
//===-- Definition of pthread macros --------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIBC_MACROS_PTHREAD_MACRO_H9#define LLVM_LIBC_MACROS_PTHREAD_MACRO_H1011#include "null-macro.h"1213#define PTHREAD_CREATE_JOINABLE 014#define PTHREAD_CREATE_DETACHED 11516#define PTHREAD_MUTEX_NORMAL 017#define PTHREAD_MUTEX_ERRORCHECK 118#define PTHREAD_MUTEX_RECURSIVE 219#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL2021#define PTHREAD_MUTEX_STALLED 022#define PTHREAD_MUTEX_ROBUST 12324#define PTHREAD_ONCE_INIT {0}2526#define PTHREAD_PROCESS_PRIVATE 027#define PTHREAD_PROCESS_SHARED 12829#ifdef __linux__30#define PTHREAD_MUTEX_INITIALIZER \31{ \32/* .__timed = */ 0, /* .__recursive = */ 0, \33/* .__robust = */ 0, /* .__owner = */ NULL, \34/* .__lock_count = */ 0, /* .__futex_word = */ {0}, \35}36#else37#define PTHREAD_MUTEX_INITIALIZER \38{ \39/* .__timed = */ 0, /* .__recursive = */ 0, \40/* .__robust = */ 0, /* .__owner = */ NULL, \41/* .__lock_count = */ 0, \42}43#endif4445#define PTHREAD_RWLOCK_INITIALIZER \46{ \47/* .__is_pshared = */ 0, \48/* .__preference = */ 0, \49/* .__state = */ 0, \50/* .__write_tid = */ 0, \51/* .__wait_queue_mutex = */ {0}, \52/* .__pending_readers = */ {0}, \53/* .__pending_writers = */ {0}, \54/* .__reader_serialization = */ {0}, \55/* .__writer_serialization = */ {0}, \56}5758// glibc extensions59#define PTHREAD_STACK_MIN (1 << 14) // 16KB60#define PTHREAD_RWLOCK_PREFER_READER_NP 061#define PTHREAD_RWLOCK_PREFER_WRITER_NP 162#define PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP 26364#endif // LLVM_LIBC_MACROS_PTHREAD_MACRO_H656667