mips: increase stack alignment in clone to match the ABI
[glibc.git] / sysdeps / nptl / bits / pthreadtypes.h
blob4d4a2553689d16136b99f1be394a53c6691cf13f
1 /* Declaration of common pthread types for all architectures.
2 Copyright (C) 2017-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
19 #ifndef _BITS_PTHREADTYPES_COMMON_H
20 # define _BITS_PTHREADTYPES_COMMON_H 1
22 /* For internal mutex and condition variable definitions. */
23 #include <bits/thread-shared-types.h>
25 /* Thread identifiers. The structure of the attribute type is not
26 exposed on purpose. */
27 typedef unsigned long int pthread_t;
30 /* Data structures for mutex handling. The structure of the attribute
31 type is not exposed on purpose. */
32 typedef union
34 char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
35 int __align;
36 } pthread_mutexattr_t;
39 /* Data structure for condition variable handling. The structure of
40 the attribute type is not exposed on purpose. */
41 typedef union
43 char __size[__SIZEOF_PTHREAD_CONDATTR_T];
44 int __align;
45 } pthread_condattr_t;
48 /* Keys for thread-specific data */
49 typedef unsigned int pthread_key_t;
52 /* Once-only execution */
53 typedef int __ONCE_ALIGNMENT pthread_once_t;
56 union pthread_attr_t
58 char __size[__SIZEOF_PTHREAD_ATTR_T];
59 long int __align;
61 #ifndef __have_pthread_attr_t
62 typedef union pthread_attr_t pthread_attr_t;
63 # define __have_pthread_attr_t 1
64 #endif
67 typedef union
69 struct __pthread_mutex_s __data;
70 char __size[__SIZEOF_PTHREAD_MUTEX_T];
71 long int __align;
72 } pthread_mutex_t;
75 typedef union
77 struct __pthread_cond_s __data;
78 char __size[__SIZEOF_PTHREAD_COND_T];
79 __extension__ long long int __align;
80 } pthread_cond_t;
83 #if defined __USE_UNIX98 || defined __USE_XOPEN2K
84 /* Data structure for reader-writer lock variable handling. The
85 structure of the attribute type is deliberately not exposed. */
86 typedef union
88 struct __pthread_rwlock_arch_t __data;
89 char __size[__SIZEOF_PTHREAD_RWLOCK_T];
90 long int __align;
91 } pthread_rwlock_t;
93 typedef union
95 char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
96 long int __align;
97 } pthread_rwlockattr_t;
98 #endif
101 #ifdef __USE_XOPEN2K
102 /* POSIX spinlock data type. */
103 typedef volatile int pthread_spinlock_t;
106 /* POSIX barriers data type. The structure of the type is
107 deliberately not exposed. */
108 typedef union
110 char __size[__SIZEOF_PTHREAD_BARRIER_T];
111 long int __align;
112 } pthread_barrier_t;
114 typedef union
116 char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
117 int __align;
118 } pthread_barrierattr_t;
119 #endif
121 #endif