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. */
34 char __size
[__SIZEOF_PTHREAD_MUTEXATTR_T
];
36 } pthread_mutexattr_t
;
39 /* Data structure for condition variable handling. The structure of
40 the attribute type is not exposed on purpose. */
43 char __size
[__SIZEOF_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
;
58 char __size
[__SIZEOF_PTHREAD_ATTR_T
];
61 #ifndef __have_pthread_attr_t
62 typedef union pthread_attr_t pthread_attr_t
;
63 # define __have_pthread_attr_t 1
69 struct __pthread_mutex_s __data
;
70 char __size
[__SIZEOF_PTHREAD_MUTEX_T
];
77 struct __pthread_cond_s __data
;
78 char __size
[__SIZEOF_PTHREAD_COND_T
];
79 __extension__
long long int __align
;
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. */
88 struct __pthread_rwlock_arch_t __data
;
89 char __size
[__SIZEOF_PTHREAD_RWLOCK_T
];
95 char __size
[__SIZEOF_PTHREAD_RWLOCKATTR_T
];
97 } pthread_rwlockattr_t
;
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. */
110 char __size
[__SIZEOF_PTHREAD_BARRIER_T
];
116 char __size
[__SIZEOF_PTHREAD_BARRIERATTR_T
];
118 } pthread_barrierattr_t
;