| 1 |
/* Implement the most essential subset of POSIX pthread.h. |
| 2 |
|
| 3 |
Copyright (C) 2009-2024 Free Software Foundation, Inc. |
| 4 |
|
| 5 |
This file is free software: you can redistribute it and/or modify |
| 6 |
it under the terms of the GNU Lesser General Public License as |
| 7 |
published by the Free Software Foundation; either version 2.1 of the |
| 8 |
License, or (at your option) any later version. |
| 9 |
|
| 10 |
This file 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 |
| 13 |
GNU Lesser General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU Lesser General Public License |
| 16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
| 17 |
|
| 18 |
/* Written by Paul Eggert, Glen Lenker, and Bruno Haible. */ |
| 19 |
|
| 20 |
#if __GNUC__ >= 3 |
| 21 |
@PRAGMA_SYSTEM_HEADER@ |
| 22 |
#endif |
| 23 |
@PRAGMA_COLUMNS@ |
| 24 |
|
| 25 |
#if defined _GL_ALREADY_INCLUDING_PTHREAD_H |
| 26 |
/* Special invocation convention: |
| 27 |
On Android, we have a sequence of nested includes |
| 28 |
<pthread.h> -> <time.h> -> <sys/time.h> -> <sys/select.h> -> |
| 29 |
<signal.h> -> <pthread.h>. |
| 30 |
In this situation, PTHREAD_COND_INITIALIZER is not yet defined, |
| 31 |
therefore we should not attempt to define PTHREAD_MUTEX_NORMAL etc. */ |
| 32 |
|
| 33 |
#@INCLUDE_NEXT@ @NEXT_PTHREAD_H@ |
| 34 |
|
| 35 |
#else |
| 36 |
/* Normal invocation convention. */ |
| 37 |
|
| 38 |
#ifndef _@GUARD_PREFIX@_PTHREAD_H_ |
| 39 |
|
| 40 |
#if @HAVE_PTHREAD_H@ |
| 41 |
|
| 42 |
# define _GL_ALREADY_INCLUDING_PTHREAD_H |
| 43 |
|
| 44 |
/* The include_next requires a split double-inclusion guard. */ |
| 45 |
# @INCLUDE_NEXT@ @NEXT_PTHREAD_H@ |
| 46 |
|
| 47 |
# undef _GL_ALREADY_INCLUDING_PTHREAD_H |
| 48 |
|
| 49 |
#endif |
| 50 |
|
| 51 |
#ifndef _@GUARD_PREFIX@_PTHREAD_H_ |
| 52 |
#define _@GUARD_PREFIX@_PTHREAD_H_ |
| 53 |
|
| 54 |
/* This file uses _Noreturn, _GL_ATTRIBUTE_PURE, GNULIB_POSIXCHECK, |
| 55 |
HAVE_RAW_DECL_*. */ |
| 56 |
#if !_GL_CONFIG_H_INCLUDED |
| 57 |
#error "Please include config.h first." |
| 58 |
#endif |
| 59 |
|
| 60 |
#define __need_system_stdlib_h |
| 61 |
#include <stdlib.h> |
| 62 |
#undef __need_system_stdlib_h |
| 63 |
|
| 64 |
|
| 65 |
/* The pthreads-win32 <pthread.h> defines a couple of broken macros. */ |
| 66 |
#undef asctime_r |
| 67 |
#undef ctime_r |
| 68 |
#undef gmtime_r |
| 69 |
#undef localtime_r |
| 70 |
#undef rand_r |
| 71 |
#undef strtok_r |
| 72 |
|
| 73 |
#include <errno.h> |
| 74 |
#include <sched.h> |
| 75 |
#include <sys/types.h> |
| 76 |
#include <time.h> |
| 77 |
|
| 78 |
/* The __attribute__ feature is available in gcc versions 2.5 and later. |
| 79 |
The attribute __pure__ was added in gcc 2.96. */ |
| 80 |
#ifndef _GL_ATTRIBUTE_PURE |
| 81 |
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ |
| 82 |
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) |
| 83 |
# else |
| 84 |
# define _GL_ATTRIBUTE_PURE /* empty */ |
| 85 |
# endif |
| 86 |
#endif |
| 87 |
|
| 88 |
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
| 89 |
|
| 90 |
/* The definition of _Noreturn is copied here. */ |
| 91 |
|
| 92 |
/* The definition of _GL_ARG_NONNULL is copied here. */ |
| 93 |
|
| 94 |
/* The definition of _GL_WARN_ON_USE is copied here. */ |
| 95 |
|
| 96 |
/* =========== Thread types and macros =========== */ |
| 97 |
|
| 98 |
#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS |
| 99 |
# if @GNULIB_PTHREAD_THREAD@ |
| 100 |
# include "windows-thread.h" |
| 101 |
# if @HAVE_PTHREAD_T@ |
| 102 |
# define pthread_t rpl_pthread_t |
| 103 |
# define pthread_attr_t rpl_pthread_attr_t |
| 104 |
# endif |
| 105 |
# if !GNULIB_defined_pthread_thread_types |
| 106 |
typedef glwthread_thread_t pthread_t; |
| 107 |
typedef unsigned int pthread_attr_t; |
| 108 |
# define GNULIB_defined_pthread_thread_types 1 |
| 109 |
# endif |
| 110 |
# else |
| 111 |
# if @HAVE_PTHREAD_T@ |
| 112 |
# define pthread_t rpl_pthread_t |
| 113 |
# define pthread_attr_t rpl_pthread_attr_t |
| 114 |
# endif |
| 115 |
# if !GNULIB_defined_pthread_thread_types |
| 116 |
typedef int pthread_t; |
| 117 |
typedef unsigned int pthread_attr_t; |
| 118 |
# define GNULIB_defined_pthread_thread_types 1 |
| 119 |
# endif |
| 120 |
# endif |
| 121 |
# undef PTHREAD_CREATE_JOINABLE |
| 122 |
# undef PTHREAD_CREATE_DETACHED |
| 123 |
# define PTHREAD_CREATE_JOINABLE 0 |
| 124 |
# define PTHREAD_CREATE_DETACHED 1 |
| 125 |
#else |
| 126 |
# if !@HAVE_PTHREAD_T@ |
| 127 |
# if !GNULIB_defined_pthread_thread_types |
| 128 |
typedef int pthread_t; |
| 129 |
typedef unsigned int pthread_attr_t; |
| 130 |
# define GNULIB_defined_pthread_thread_types 1 |
| 131 |
# endif |
| 132 |
# endif |
| 133 |
# if !@HAVE_PTHREAD_CREATE_DETACHED@ |
| 134 |
# define PTHREAD_CREATE_JOINABLE 0 |
| 135 |
# define PTHREAD_CREATE_DETACHED 1 |
| 136 |
# endif |
| 137 |
#endif |
| 138 |
|
| 139 |
/* =========== Once-only control (initialization) types and macros ========== */ |
| 140 |
|
| 141 |
#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS |
| 142 |
# if @GNULIB_PTHREAD_ONCE@ |
| 143 |
# include "windows-once.h" |
| 144 |
# if @HAVE_PTHREAD_T@ |
| 145 |
# define pthread_once_t rpl_pthread_once_t |
| 146 |
# endif |
| 147 |
# if !GNULIB_defined_pthread_once_types |
| 148 |
typedef glwthread_once_t pthread_once_t; |
| 149 |
# define GNULIB_defined_pthread_once_types 1 |
| 150 |
# endif |
| 151 |
# undef PTHREAD_ONCE_INIT |
| 152 |
# define PTHREAD_ONCE_INIT GLWTHREAD_ONCE_INIT |
| 153 |
# else |
| 154 |
# if @HAVE_PTHREAD_T@ |
| 155 |
# define pthread_once_t rpl_pthread_once_t |
| 156 |
# endif |
| 157 |
# if !GNULIB_defined_pthread_once_types |
| 158 |
typedef int pthread_once_t; |
| 159 |
# define GNULIB_defined_pthread_once_types 1 |
| 160 |
# endif |
| 161 |
# undef PTHREAD_ONCE_INIT |
| 162 |
# define PTHREAD_ONCE_INIT { 0 } |
| 163 |
# endif |
| 164 |
#else |
| 165 |
# if !@HAVE_PTHREAD_T@ |
| 166 |
# if !GNULIB_defined_pthread_once_types |
| 167 |
typedef int pthread_once_t; |
| 168 |
# define GNULIB_defined_pthread_once_types 1 |
| 169 |
# endif |
| 170 |
# undef PTHREAD_ONCE_INIT |
| 171 |
# define PTHREAD_ONCE_INIT { 0 } |
| 172 |
# endif |
| 173 |
#endif |
| 174 |
|
| 175 |
/* =========== Mutex types and macros =========== */ |
| 176 |
|
| 177 |
#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS |
| 178 |
# if @GNULIB_PTHREAD_MUTEX@ |
| 179 |
# include "windows-timedmutex.h" |
| 180 |
# include "windows-timedrecmutex.h" |
| 181 |
# if @HAVE_PTHREAD_T@ |
| 182 |
# define pthread_mutex_t rpl_pthread_mutex_t |
| 183 |
# define pthread_mutexattr_t rpl_pthread_mutexattr_t |
| 184 |
# endif |
| 185 |
# if !GNULIB_defined_pthread_mutex_types |
| 186 |
typedef struct |
| 187 |
{ |
| 188 |
int type; |
| 189 |
union |
| 190 |
{ |
| 191 |
glwthread_timedmutex_t u_timedmutex; |
| 192 |
glwthread_timedrecmutex_t u_timedrecmutex; |
| 193 |
} |
| 194 |
u; |
| 195 |
} |
| 196 |
pthread_mutex_t; |
| 197 |
typedef unsigned int pthread_mutexattr_t; |
| 198 |
# define GNULIB_defined_pthread_mutex_types 1 |
| 199 |
# endif |
| 200 |
# undef PTHREAD_MUTEX_INITIALIZER |
| 201 |
# define PTHREAD_MUTEX_INITIALIZER { 1, { GLWTHREAD_TIMEDMUTEX_INIT } } |
| 202 |
# else |
| 203 |
# if @HAVE_PTHREAD_T@ |
| 204 |
# define pthread_mutex_t rpl_pthread_mutex_t |
| 205 |
# define pthread_mutexattr_t rpl_pthread_mutexattr_t |
| 206 |
# endif |
| 207 |
# if !GNULIB_defined_pthread_mutex_types |
| 208 |
typedef int pthread_mutex_t; |
| 209 |
typedef unsigned int pthread_mutexattr_t; |
| 210 |
# define GNULIB_defined_pthread_mutex_types 1 |
| 211 |
# endif |
| 212 |
# undef PTHREAD_MUTEX_INITIALIZER |
| 213 |
# define PTHREAD_MUTEX_INITIALIZER { 0 } |
| 214 |
# endif |
| 215 |
# undef PTHREAD_MUTEX_DEFAULT |
| 216 |
# undef PTHREAD_MUTEX_NORMAL |
| 217 |
# undef PTHREAD_MUTEX_ERRORCHECK |
| 218 |
# undef PTHREAD_MUTEX_RECURSIVE |
| 219 |
# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL |
| 220 |
# define PTHREAD_MUTEX_NORMAL 0 |
| 221 |
# define PTHREAD_MUTEX_ERRORCHECK 1 |
| 222 |
# define PTHREAD_MUTEX_RECURSIVE 2 |
| 223 |
# undef PTHREAD_MUTEX_STALLED |
| 224 |
# undef PTHREAD_MUTEX_ROBUST |
| 225 |
# define PTHREAD_MUTEX_STALLED 0 |
| 226 |
# define PTHREAD_MUTEX_ROBUST 1 |
| 227 |
#else |
| 228 |
# if !@HAVE_PTHREAD_T@ |
| 229 |
# if !GNULIB_defined_pthread_mutex_types |
| 230 |
typedef int pthread_mutex_t; |
| 231 |
typedef unsigned int pthread_mutexattr_t; |
| 232 |
# define GNULIB_defined_pthread_mutex_types 1 |
| 233 |
# endif |
| 234 |
# undef PTHREAD_MUTEX_INITIALIZER |
| 235 |
# define PTHREAD_MUTEX_INITIALIZER { 0 } |
| 236 |
# endif |
| 237 |
# if !@HAVE_PTHREAD_MUTEX_RECURSIVE@ |
| 238 |
# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL |
| 239 |
# define PTHREAD_MUTEX_NORMAL 0 |
| 240 |
# define PTHREAD_MUTEX_ERRORCHECK 1 |
| 241 |
# define PTHREAD_MUTEX_RECURSIVE 2 |
| 242 |
# endif |
| 243 |
# if !@HAVE_PTHREAD_MUTEX_ROBUST@ |
| 244 |
# define PTHREAD_MUTEX_STALLED 0 |
| 245 |
# define PTHREAD_MUTEX_ROBUST 1 |
| 246 |
# endif |
| 247 |
#endif |
| 248 |
|
| 249 |
/* =========== Read-write lock types and macros =========== */ |
| 250 |
|
| 251 |
#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS |
| 252 |
# if @GNULIB_PTHREAD_RWLOCK@ |
| 253 |
# include "windows-timedrwlock.h" |
| 254 |
# if @HAVE_PTHREAD_T@ |
| 255 |
# define pthread_rwlock_t rpl_pthread_rwlock_t |
| 256 |
# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t |
| 257 |
# endif |
| 258 |
# if !GNULIB_defined_pthread_rwlock_types |
| 259 |
typedef glwthread_timedrwlock_t pthread_rwlock_t; |
| 260 |
typedef unsigned int pthread_rwlockattr_t; |
| 261 |
# define GNULIB_defined_pthread_rwlock_types 1 |
| 262 |
# endif |
| 263 |
# undef PTHREAD_RWLOCK_INITIALIZER |
| 264 |
# define PTHREAD_RWLOCK_INITIALIZER GLWTHREAD_TIMEDRWLOCK_INIT |
| 265 |
# else |
| 266 |
# if @HAVE_PTHREAD_T@ |
| 267 |
# define pthread_rwlock_t rpl_pthread_rwlock_t |
| 268 |
# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t |
| 269 |
# endif |
| 270 |
# if !GNULIB_defined_pthread_rwlock_types |
| 271 |
typedef int pthread_rwlock_t; |
| 272 |
typedef unsigned int pthread_rwlockattr_t; |
| 273 |
# define GNULIB_defined_pthread_rwlock_types 1 |
| 274 |
# endif |
| 275 |
# undef PTHREAD_RWLOCK_INITIALIZER |
| 276 |
# define PTHREAD_RWLOCK_INITIALIZER { 0 } |
| 277 |
# endif |
| 278 |
#elif @GNULIB_PTHREAD_RWLOCK@ && @REPLACE_PTHREAD_RWLOCK_DESTROY@ /* i.e. PTHREAD_RWLOCK_UNIMPLEMENTED */ |
| 279 |
# if @HAVE_PTHREAD_T@ |
| 280 |
# define pthread_rwlock_t rpl_pthread_rwlock_t |
| 281 |
# define pthread_rwlockattr_t rpl_pthread_rwlockattr_t |
| 282 |
# endif |
| 283 |
# if !GNULIB_defined_pthread_rwlock_types |
| 284 |
typedef struct |
| 285 |
{ |
| 286 |
pthread_mutex_t lock; /* protects the remaining fields */ |
| 287 |
pthread_cond_t waiting_readers; /* waiting readers */ |
| 288 |
pthread_cond_t waiting_writers; /* waiting writers */ |
| 289 |
unsigned int waiting_writers_count; /* number of waiting writers */ |
| 290 |
int runcount; /* number of readers running, or -1 when a writer runs */ |
| 291 |
} |
| 292 |
pthread_rwlock_t; |
| 293 |
typedef unsigned int pthread_rwlockattr_t; |
| 294 |
# define GNULIB_defined_pthread_rwlock_types 1 |
| 295 |
# endif |
| 296 |
# undef PTHREAD_RWLOCK_INITIALIZER |
| 297 |
# define PTHREAD_RWLOCK_INITIALIZER \ |
| 298 |
{ PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 } |
| 299 |
#elif @GNULIB_PTHREAD_RWLOCK@ && @REPLACE_PTHREAD_RWLOCK_INIT@ /* i.e. PTHREAD_RWLOCK_BAD_WAITQUEUE */ |
| 300 |
/* Use rwlocks of kind PREFER_WRITER or PREFER_WRITER_NONRECURSIVE instead of |
| 301 |
the DEFAULT. */ |
| 302 |
# undef PTHREAD_RWLOCK_INITIALIZER |
| 303 |
# define PTHREAD_RWLOCK_INITIALIZER PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP |
| 304 |
#else |
| 305 |
# if @HAVE_PTHREAD_T@ |
| 306 |
# if !defined PTHREAD_RWLOCK_INITIALIZER && defined PTHREAD_RWLOCK_INITIALIZER_NP /* z/OS */ |
| 307 |
# define PTHREAD_RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER_NP |
| 308 |
# endif |
| 309 |
# else |
| 310 |
# if !GNULIB_defined_pthread_rwlock_types |
| 311 |
typedef int pthread_rwlock_t; |
| 312 |
typedef unsigned int pthread_rwlockattr_t; |
| 313 |
# define GNULIB_defined_pthread_rwlock_types 1 |
| 314 |
# endif |
| 315 |
# undef PTHREAD_RWLOCK_INITIALIZER |
| 316 |
# define PTHREAD_RWLOCK_INITIALIZER { 0 } |
| 317 |
# endif |
| 318 |
#endif |
| 319 |
|
| 320 |
/* =========== Condition variable types and macros =========== */ |
| 321 |
|
| 322 |
#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS |
| 323 |
# if @GNULIB_PTHREAD_COND@ |
| 324 |
# include "windows-cond.h" |
| 325 |
# if @HAVE_PTHREAD_T@ |
| 326 |
# define pthread_cond_t rpl_pthread_cond_t |
| 327 |
# define pthread_condattr_t rpl_pthread_condattr_t |
| 328 |
# endif |
| 329 |
# if !GNULIB_defined_pthread_cond_types |
| 330 |
typedef glwthread_cond_t pthread_cond_t; |
| 331 |
typedef unsigned int pthread_condattr_t; |
| 332 |
# define GNULIB_defined_pthread_cond_types 1 |
| 333 |
# endif |
| 334 |
# undef PTHREAD_COND_INITIALIZER |
| 335 |
# define PTHREAD_COND_INITIALIZER GLWTHREAD_COND_INIT |
| 336 |
# else |
| 337 |
# if @HAVE_PTHREAD_T@ |
| 338 |
# define pthread_cond_t rpl_pthread_cond_t |
| 339 |
# define pthread_condattr_t rpl_pthread_condattr_t |
| 340 |
# endif |
| 341 |
# if !GNULIB_defined_pthread_cond_types |
| 342 |
typedef int pthread_cond_t; |
| 343 |
typedef unsigned int pthread_condattr_t; |
| 344 |
# define GNULIB_defined_pthread_cond_types 1 |
| 345 |
# endif |
| 346 |
# undef PTHREAD_COND_INITIALIZER |
| 347 |
# define PTHREAD_COND_INITIALIZER { 0 } |
| 348 |
# endif |
| 349 |
#else |
| 350 |
# if !@HAVE_PTHREAD_T@ |
| 351 |
# if !GNULIB_defined_pthread_cond_types |
| 352 |
typedef int pthread_cond_t; |
| 353 |
typedef unsigned int pthread_condattr_t; |
| 354 |
# define GNULIB_defined_pthread_cond_types 1 |
| 355 |
# endif |
| 356 |
# undef PTHREAD_COND_INITIALIZER |
| 357 |
# define PTHREAD_COND_INITIALIZER { 0 } |
| 358 |
# endif |
| 359 |
#endif |
| 360 |
|
| 361 |
/* =========== Thread-specific storage types and macros =========== */ |
| 362 |
|
| 363 |
#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS |
| 364 |
# if @GNULIB_PTHREAD_TSS@ |
| 365 |
# include "windows-tls.h" |
| 366 |
# if @HAVE_PTHREAD_T@ |
| 367 |
# define pthread_key_t rpl_pthread_key_t |
| 368 |
# endif |
| 369 |
# if !GNULIB_defined_pthread_tss_types |
| 370 |
typedef glwthread_tls_key_t pthread_key_t; |
| 371 |
# define GNULIB_defined_pthread_tss_types 1 |
| 372 |
# endif |
| 373 |
# undef PTHREAD_DESTRUCTOR_ITERATIONS |
| 374 |
# define PTHREAD_DESTRUCTOR_ITERATIONS GLWTHREAD_DESTRUCTOR_ITERATIONS |
| 375 |
# else |
| 376 |
# if @HAVE_PTHREAD_T@ |
| 377 |
# define pthread_key_t rpl_pthread_key_t |
| 378 |
# endif |
| 379 |
# if !GNULIB_defined_pthread_tss_types |
| 380 |
typedef void ** pthread_key_t; |
| 381 |
# define GNULIB_defined_pthread_tss_types 1 |
| 382 |
# endif |
| 383 |
# undef PTHREAD_DESTRUCTOR_ITERATIONS |
| 384 |
# define PTHREAD_DESTRUCTOR_ITERATIONS 0 |
| 385 |
# endif |
| 386 |
#else |
| 387 |
# if !@HAVE_PTHREAD_T@ |
| 388 |
# if !GNULIB_defined_pthread_tss_types |
| 389 |
typedef void ** pthread_key_t; |
| 390 |
# define GNULIB_defined_pthread_tss_types 1 |
| 391 |
# endif |
| 392 |
# undef PTHREAD_DESTRUCTOR_ITERATIONS |
| 393 |
# define PTHREAD_DESTRUCTOR_ITERATIONS 0 |
| 394 |
# endif |
| 395 |
#endif |
| 396 |
|
| 397 |
/* =========== Spinlock types and macros =========== */ |
| 398 |
|
| 399 |
#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS |
| 400 |
# if @GNULIB_PTHREAD_SPIN@ |
| 401 |
# include "windows-spin.h" |
| 402 |
# if @HAVE_PTHREAD_T@ |
| 403 |
# define pthread_spinlock_t rpl_pthread_spinlock_t |
| 404 |
# endif |
| 405 |
# if !GNULIB_defined_pthread_spin_types |
| 406 |
typedef glwthread_spinlock_t pthread_spinlock_t; |
| 407 |
# define GNULIB_defined_pthread_spin_types 1 |
| 408 |
# endif |
| 409 |
# else |
| 410 |
# if @HAVE_PTHREAD_T@ |
| 411 |
# define pthread_spinlock_t rpl_pthread_spinlock_t |
| 412 |
# endif |
| 413 |
# if !GNULIB_defined_pthread_spin_types |
| 414 |
typedef pthread_mutex_t pthread_spinlock_t; |
| 415 |
# define GNULIB_defined_pthread_spin_types 1 |
| 416 |
# endif |
| 417 |
# endif |
| 418 |
# undef PTHREAD_PROCESS_PRIVATE |
| 419 |
# undef PTHREAD_PROCESS_SHARED |
| 420 |
# define PTHREAD_PROCESS_PRIVATE 0 |
| 421 |
# define PTHREAD_PROCESS_SHARED 1 |
| 422 |
#else |
| 423 |
# if @HAVE_PTHREAD_SPINLOCK_T@ |
| 424 |
/* <pthread.h> exists and defines pthread_spinlock_t. */ |
| 425 |
# if !@HAVE_PTHREAD_SPIN_INIT@ || @REPLACE_PTHREAD_SPIN_INIT@ |
| 426 |
/* If the 'pthread-spin' module is in use, it defines all the pthread_spin* |
| 427 |
functions. Prepare for it by overriding pthread_spinlock_t if that might |
| 428 |
be needed. */ |
| 429 |
# if !(((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) \ |
| 430 |
|| __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 1)) \ |
| 431 |
|| (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \ |
| 432 |
&& !defined __ANDROID__) \ |
| 433 |
|| __clang_major__ >= 3)) \ |
| 434 |
&& !defined __ibmxl__) |
| 435 |
/* We can't use GCC built-ins. Approximate spinlocks with mutexes. */ |
| 436 |
# if !GNULIB_defined_pthread_spin_types |
| 437 |
# define pthread_spinlock_t pthread_mutex_t |
| 438 |
# define GNULIB_defined_pthread_spin_types 1 |
| 439 |
# endif |
| 440 |
# endif |
| 441 |
# endif |
| 442 |
# else |
| 443 |
/* Approximate spinlocks with mutexes. */ |
| 444 |
# if !GNULIB_defined_pthread_spin_types |
| 445 |
typedef pthread_mutex_t pthread_spinlock_t; |
| 446 |
# define GNULIB_defined_pthread_spin_types 1 |
| 447 |
# endif |
| 448 |
# endif |
| 449 |
# if !@HAVE_PTHREAD_PROCESS_SHARED@ |
| 450 |
# define PTHREAD_PROCESS_PRIVATE 0 |
| 451 |
# define PTHREAD_PROCESS_SHARED 1 |
| 452 |
# endif |
| 453 |
#endif |
| 454 |
|
| 455 |
/* =========== Other types and macros =========== */ |
| 456 |
|
| 457 |
#if !@HAVE_PTHREAD_T@ |
| 458 |
# if !GNULIB_defined_other_pthread_types |
| 459 |
typedef int pthread_barrier_t; |
| 460 |
typedef unsigned int pthread_barrierattr_t; |
| 461 |
# define GNULIB_defined_other_pthread_types 1 |
| 462 |
# endif |
| 463 |
#endif |
| 464 |
|
| 465 |
#if !defined PTHREAD_CANCELED |
| 466 |
|
| 467 |
# define PTHREAD_BARRIER_SERIAL_THREAD (-1) |
| 468 |
|
| 469 |
# define PTHREAD_CANCEL_DEFERRED 0 |
| 470 |
# define PTHREAD_CANCEL_ASYNCHRONOUS 1 |
| 471 |
|
| 472 |
# define PTHREAD_CANCEL_ENABLE 0 |
| 473 |
# define PTHREAD_CANCEL_DISABLE 1 |
| 474 |
|
| 475 |
# define PTHREAD_CANCELED ((void *) -1) |
| 476 |
|
| 477 |
# define PTHREAD_INHERIT_SCHED 0 |
| 478 |
# define PTHREAD_EXPLICIT_SCHED 1 |
| 479 |
|
| 480 |
# define PTHREAD_PRIO_NONE 0 |
| 481 |
# define PTHREAD_PRIO_INHERIT 1 |
| 482 |
# define PTHREAD_PRIO_PROTECT 2 |
| 483 |
|
| 484 |
# define PTHREAD_SCOPE_SYSTEM 0 |
| 485 |
# define PTHREAD_SCOPE_PROCESS 1 |
| 486 |
|
| 487 |
#endif |
| 488 |
|
| 489 |
/* =========== Thread functions =========== */ |
| 490 |
|
| 491 |
#if @GNULIB_PTHREAD_THREAD@ |
| 492 |
/* The 'restrict' qualifier on ARG is nonsense, but POSIX specifies it this way. |
| 493 |
Sigh. */ |
| 494 |
# if @REPLACE_PTHREAD_CREATE@ |
| 495 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 496 |
# undef pthread_create |
| 497 |
# define pthread_create rpl_pthread_create |
| 498 |
# endif |
| 499 |
_GL_FUNCDECL_RPL (pthread_create, int, |
| 500 |
(pthread_t *restrict threadp, |
| 501 |
const pthread_attr_t *restrict attr, |
| 502 |
void * (*mainfunc) (void *), void *restrict arg), |
| 503 |
_GL_ARG_NONNULL ((1, 3))); |
| 504 |
_GL_CXXALIAS_RPL (pthread_create, int, |
| 505 |
(pthread_t *restrict threadp, |
| 506 |
const pthread_attr_t *restrict attr, |
| 507 |
void * (*mainfunc) (void *), void *restrict arg)); |
| 508 |
# else |
| 509 |
# if !@HAVE_PTHREAD_CREATE@ |
| 510 |
_GL_FUNCDECL_SYS (pthread_create, int, |
| 511 |
(pthread_t *restrict threadp, |
| 512 |
const pthread_attr_t *restrict attr, |
| 513 |
void * (*mainfunc) (void *), void *restrict arg), |
| 514 |
_GL_ARG_NONNULL ((1, 3))); |
| 515 |
# endif |
| 516 |
_GL_CXXALIAS_SYS_CAST (pthread_create, int, |
| 517 |
(pthread_t *restrict threadp, |
| 518 |
const pthread_attr_t *restrict attr, |
| 519 |
void * (*mainfunc) (void *), void *restrict arg)); |
| 520 |
# endif |
| 521 |
# if __GLIBC__ >= 2 |
| 522 |
_GL_CXXALIASWARN (pthread_create); |
| 523 |
# endif |
| 524 |
#elif defined GNULIB_POSIXCHECK |
| 525 |
# undef pthread_create |
| 526 |
# if HAVE_RAW_DECL_PTHREAD_CREATE |
| 527 |
_GL_WARN_ON_USE (pthread_create, "pthread_create is not portable - " |
| 528 |
"use gnulib module pthread-thread for portability"); |
| 529 |
# endif |
| 530 |
#endif |
| 531 |
|
| 532 |
#if @GNULIB_PTHREAD_THREAD@ |
| 533 |
# if @REPLACE_PTHREAD_ATTR_INIT@ |
| 534 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 535 |
# undef pthread_attr_init |
| 536 |
# define pthread_attr_init rpl_pthread_attr_init |
| 537 |
# endif |
| 538 |
_GL_FUNCDECL_RPL (pthread_attr_init, int, (pthread_attr_t *attr), |
| 539 |
_GL_ARG_NONNULL ((1))); |
| 540 |
_GL_CXXALIAS_RPL (pthread_attr_init, int, (pthread_attr_t *attr)); |
| 541 |
# else |
| 542 |
# if !@HAVE_PTHREAD_ATTR_INIT@ |
| 543 |
_GL_FUNCDECL_SYS (pthread_attr_init, int, (pthread_attr_t *attr), |
| 544 |
_GL_ARG_NONNULL ((1))); |
| 545 |
# endif |
| 546 |
_GL_CXXALIAS_SYS (pthread_attr_init, int, (pthread_attr_t *attr)); |
| 547 |
# endif |
| 548 |
# if __GLIBC__ >= 2 |
| 549 |
_GL_CXXALIASWARN (pthread_attr_init); |
| 550 |
# endif |
| 551 |
#elif defined GNULIB_POSIXCHECK |
| 552 |
# undef pthread_attr_init |
| 553 |
# if HAVE_RAW_DECL_PTHREAD_ATTR_INIT |
| 554 |
_GL_WARN_ON_USE (pthread_attr_init, "pthread_attr_init is not portable - " |
| 555 |
"use gnulib module pthread-thread for portability"); |
| 556 |
# endif |
| 557 |
#endif |
| 558 |
|
| 559 |
#if @GNULIB_PTHREAD_THREAD@ |
| 560 |
# if @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@ |
| 561 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 562 |
# undef pthread_attr_getdetachstate |
| 563 |
# define pthread_attr_getdetachstate rpl_pthread_attr_getdetachstate |
| 564 |
# endif |
| 565 |
_GL_FUNCDECL_RPL (pthread_attr_getdetachstate, int, |
| 566 |
(const pthread_attr_t *attr, int *detachstatep), |
| 567 |
_GL_ARG_NONNULL ((1, 2))); |
| 568 |
_GL_CXXALIAS_RPL (pthread_attr_getdetachstate, int, |
| 569 |
(const pthread_attr_t *attr, int *detachstatep)); |
| 570 |
# else |
| 571 |
# if !@HAVE_PTHREAD_ATTR_GETDETACHSTATE@ |
| 572 |
_GL_FUNCDECL_SYS (pthread_attr_getdetachstate, int, |
| 573 |
(const pthread_attr_t *attr, int *detachstatep), |
| 574 |
_GL_ARG_NONNULL ((1, 2))); |
| 575 |
# endif |
| 576 |
_GL_CXXALIAS_SYS (pthread_attr_getdetachstate, int, |
| 577 |
(const pthread_attr_t *attr, int *detachstatep)); |
| 578 |
# endif |
| 579 |
# if __GLIBC__ >= 2 |
| 580 |
_GL_CXXALIASWARN (pthread_attr_getdetachstate); |
| 581 |
# endif |
| 582 |
#elif defined GNULIB_POSIXCHECK |
| 583 |
# undef pthread_attr_getdetachstate |
| 584 |
# if HAVE_RAW_DECL_PTHREAD_ATTR_GETDETACHSTATE |
| 585 |
_GL_WARN_ON_USE (pthread_attr_getdetachstate, "pthread_attr_getdetachstate is not portable - " |
| 586 |
"use gnulib module pthread-thread for portability"); |
| 587 |
# endif |
| 588 |
#endif |
| 589 |
|
| 590 |
#if @GNULIB_PTHREAD_THREAD@ |
| 591 |
# if @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@ |
| 592 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 593 |
# undef pthread_attr_setdetachstate |
| 594 |
# define pthread_attr_setdetachstate rpl_pthread_attr_setdetachstate |
| 595 |
# endif |
| 596 |
_GL_FUNCDECL_RPL (pthread_attr_setdetachstate, int, |
| 597 |
(pthread_attr_t *attr, int detachstate), |
| 598 |
_GL_ARG_NONNULL ((1))); |
| 599 |
_GL_CXXALIAS_RPL (pthread_attr_setdetachstate, int, |
| 600 |
(pthread_attr_t *attr, int detachstate)); |
| 601 |
# else |
| 602 |
# if !@HAVE_PTHREAD_ATTR_SETDETACHSTATE@ |
| 603 |
_GL_FUNCDECL_SYS (pthread_attr_setdetachstate, int, |
| 604 |
(pthread_attr_t *attr, int detachstate), |
| 605 |
_GL_ARG_NONNULL ((1))); |
| 606 |
# endif |
| 607 |
_GL_CXXALIAS_SYS (pthread_attr_setdetachstate, int, |
| 608 |
(pthread_attr_t *attr, int detachstate)); |
| 609 |
# endif |
| 610 |
# if __GLIBC__ >= 2 |
| 611 |
_GL_CXXALIASWARN (pthread_attr_setdetachstate); |
| 612 |
# endif |
| 613 |
#elif defined GNULIB_POSIXCHECK |
| 614 |
# undef pthread_attr_setdetachstate |
| 615 |
# if HAVE_RAW_DECL_PTHREAD_ATTR_SETDETACHSTATE |
| 616 |
_GL_WARN_ON_USE (pthread_attr_setdetachstate, "pthread_attr_setdetachstate is not portable - " |
| 617 |
"use gnulib module pthread-thread for portability"); |
| 618 |
# endif |
| 619 |
#endif |
| 620 |
|
| 621 |
#if @GNULIB_PTHREAD_THREAD@ |
| 622 |
# if @REPLACE_PTHREAD_ATTR_DESTROY@ |
| 623 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 624 |
# undef pthread_attr_destroy |
| 625 |
# define pthread_attr_destroy rpl_pthread_attr_destroy |
| 626 |
# endif |
| 627 |
_GL_FUNCDECL_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr), |
| 628 |
_GL_ARG_NONNULL ((1))); |
| 629 |
_GL_CXXALIAS_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr)); |
| 630 |
# else |
| 631 |
# if !@HAVE_PTHREAD_ATTR_DESTROY@ |
| 632 |
_GL_FUNCDECL_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr), |
| 633 |
_GL_ARG_NONNULL ((1))); |
| 634 |
# endif |
| 635 |
_GL_CXXALIAS_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr)); |
| 636 |
# endif |
| 637 |
# if __GLIBC__ >= 2 |
| 638 |
_GL_CXXALIASWARN (pthread_attr_destroy); |
| 639 |
# endif |
| 640 |
#elif defined GNULIB_POSIXCHECK |
| 641 |
# undef pthread_attr_destroy |
| 642 |
# if HAVE_RAW_DECL_PTHREAD_ATTR_DESTROY |
| 643 |
_GL_WARN_ON_USE (pthread_attr_destroy, "pthread_attr_destroy is not portable - " |
| 644 |
"use gnulib module pthread-thread for portability"); |
| 645 |
# endif |
| 646 |
#endif |
| 647 |
|
| 648 |
#if @GNULIB_PTHREAD_THREAD@ |
| 649 |
# if @REPLACE_PTHREAD_SELF@ |
| 650 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 651 |
# undef pthread_self |
| 652 |
# define pthread_self rpl_pthread_self |
| 653 |
# endif |
| 654 |
_GL_FUNCDECL_RPL (pthread_self, pthread_t, (void), _GL_ATTRIBUTE_PURE); |
| 655 |
_GL_CXXALIAS_RPL (pthread_self, pthread_t, (void)); |
| 656 |
# else |
| 657 |
# if !@HAVE_PTHREAD_SELF@ |
| 658 |
_GL_FUNCDECL_SYS (pthread_self, pthread_t, (void), _GL_ATTRIBUTE_PURE); |
| 659 |
# endif |
| 660 |
_GL_CXXALIAS_SYS (pthread_self, pthread_t, (void)); |
| 661 |
# endif |
| 662 |
# if __GLIBC__ >= 2 |
| 663 |
_GL_CXXALIASWARN (pthread_self); |
| 664 |
# endif |
| 665 |
#elif defined GNULIB_POSIXCHECK |
| 666 |
# undef pthread_self |
| 667 |
# if HAVE_RAW_DECL_PTHREAD_SELF |
| 668 |
_GL_WARN_ON_USE (pthread_self, "pthread_self is not portable - " |
| 669 |
"use gnulib module pthread-thread for portability"); |
| 670 |
# endif |
| 671 |
#endif |
| 672 |
|
| 673 |
#if @GNULIB_PTHREAD_THREAD@ |
| 674 |
# if @REPLACE_PTHREAD_EQUAL@ |
| 675 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 676 |
# undef pthread_equal |
| 677 |
# define pthread_equal rpl_pthread_equal |
| 678 |
# endif |
| 679 |
_GL_FUNCDECL_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2), ); |
| 680 |
_GL_CXXALIAS_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); |
| 681 |
# else |
| 682 |
# if !@HAVE_PTHREAD_EQUAL@ |
| 683 |
_GL_FUNCDECL_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2), ); |
| 684 |
# endif |
| 685 |
_GL_CXXALIAS_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); |
| 686 |
# endif |
| 687 |
# if __GLIBC__ >= 2 |
| 688 |
_GL_CXXALIASWARN (pthread_equal); |
| 689 |
# endif |
| 690 |
#elif defined GNULIB_POSIXCHECK |
| 691 |
# undef pthread_equal |
| 692 |
# if HAVE_RAW_DECL_PTHREAD_EQUAL |
| 693 |
_GL_WARN_ON_USE (pthread_equal, "pthread_equal is not portable - " |
| 694 |
"use gnulib module pthread-thread for portability"); |
| 695 |
# endif |
| 696 |
#endif |
| 697 |
|
| 698 |
#if @GNULIB_PTHREAD_THREAD@ |
| 699 |
# if @REPLACE_PTHREAD_DETACH@ |
| 700 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 701 |
# undef pthread_detach |
| 702 |
# define pthread_detach rpl_pthread_detach |
| 703 |
# endif |
| 704 |
_GL_FUNCDECL_RPL (pthread_detach, int, (pthread_t thread), ); |
| 705 |
_GL_CXXALIAS_RPL (pthread_detach, int, (pthread_t thread)); |
| 706 |
# else |
| 707 |
# if !@HAVE_PTHREAD_DETACH@ |
| 708 |
_GL_FUNCDECL_SYS (pthread_detach, int, (pthread_t thread), ); |
| 709 |
# endif |
| 710 |
_GL_CXXALIAS_SYS (pthread_detach, int, (pthread_t thread)); |
| 711 |
# endif |
| 712 |
# if __GLIBC__ >= 2 |
| 713 |
_GL_CXXALIASWARN (pthread_detach); |
| 714 |
# endif |
| 715 |
#elif defined GNULIB_POSIXCHECK |
| 716 |
# undef pthread_detach |
| 717 |
# if HAVE_RAW_DECL_PTHREAD_DETACH |
| 718 |
_GL_WARN_ON_USE (pthread_detach, "pthread_detach is not portable - " |
| 719 |
"use gnulib module pthread-thread for portability"); |
| 720 |
# endif |
| 721 |
#endif |
| 722 |
|
| 723 |
#if @GNULIB_PTHREAD_THREAD@ |
| 724 |
# if @REPLACE_PTHREAD_JOIN@ |
| 725 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 726 |
# undef pthread_join |
| 727 |
# define pthread_join rpl_pthread_join |
| 728 |
# endif |
| 729 |
_GL_FUNCDECL_RPL (pthread_join, int, (pthread_t thread, void **valuep), ); |
| 730 |
_GL_CXXALIAS_RPL (pthread_join, int, (pthread_t thread, void **valuep)); |
| 731 |
# else |
| 732 |
# if !@HAVE_PTHREAD_JOIN@ |
| 733 |
_GL_FUNCDECL_SYS (pthread_join, int, (pthread_t thread, void **valuep), ); |
| 734 |
# endif |
| 735 |
_GL_CXXALIAS_SYS (pthread_join, int, (pthread_t thread, void **valuep)); |
| 736 |
# endif |
| 737 |
# if __GLIBC__ >= 2 |
| 738 |
_GL_CXXALIASWARN (pthread_join); |
| 739 |
# endif |
| 740 |
#elif defined GNULIB_POSIXCHECK |
| 741 |
# undef pthread_join |
| 742 |
# if HAVE_RAW_DECL_PTHREAD_JOIN |
| 743 |
_GL_WARN_ON_USE (pthread_join, "pthread_join is not portable - " |
| 744 |
"use gnulib module pthread-thread for portability"); |
| 745 |
# endif |
| 746 |
#endif |
| 747 |
|
| 748 |
#if @GNULIB_PTHREAD_THREAD@ |
| 749 |
# if @REPLACE_PTHREAD_EXIT@ |
| 750 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 751 |
# undef pthread_exit |
| 752 |
# define pthread_exit rpl_pthread_exit |
| 753 |
# endif |
| 754 |
_GL_FUNCDECL_RPL (pthread_exit, _Noreturn void, (void *value), ); |
| 755 |
_GL_CXXALIAS_RPL (pthread_exit, void, (void *value)); |
| 756 |
# else |
| 757 |
# if !@HAVE_PTHREAD_EXIT@ |
| 758 |
_GL_FUNCDECL_SYS (pthread_exit, _Noreturn void, (void *value), ); |
| 759 |
# endif |
| 760 |
/* Need to cast because of AIX with xlclang++. */ |
| 761 |
_GL_CXXALIAS_SYS_CAST (pthread_exit, void, (void *value)); |
| 762 |
# endif |
| 763 |
# if __GLIBC__ >= 2 |
| 764 |
_GL_CXXALIASWARN (pthread_exit); |
| 765 |
# endif |
| 766 |
#elif defined GNULIB_POSIXCHECK |
| 767 |
# undef pthread_exit |
| 768 |
# if HAVE_RAW_DECL_PTHREAD_EXIT |
| 769 |
_GL_WARN_ON_USE (pthread_exit, "pthread_exit is not portable - " |
| 770 |
"use gnulib module pthread-thread for portability"); |
| 771 |
# endif |
| 772 |
#endif |
| 773 |
|
| 774 |
/* =========== Once-only control (initialization) functions =========== */ |
| 775 |
|
| 776 |
#if @GNULIB_PTHREAD_ONCE@ |
| 777 |
# if @REPLACE_PTHREAD_ONCE@ |
| 778 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 779 |
# undef pthread_once |
| 780 |
# define pthread_once rpl_pthread_once |
| 781 |
# endif |
| 782 |
_GL_FUNCDECL_RPL (pthread_once, int, |
| 783 |
(pthread_once_t *once_control, void (*initfunction) (void)), |
| 784 |
_GL_ARG_NONNULL ((1, 2))); |
| 785 |
_GL_CXXALIAS_RPL (pthread_once, int, |
| 786 |
(pthread_once_t *once_control, void (*initfunction) (void))); |
| 787 |
# else |
| 788 |
# if !@HAVE_PTHREAD_ONCE@ |
| 789 |
_GL_FUNCDECL_SYS (pthread_once, int, |
| 790 |
(pthread_once_t *once_control, void (*initfunction) (void)), |
| 791 |
_GL_ARG_NONNULL ((1, 2))); |
| 792 |
# endif |
| 793 |
_GL_CXXALIAS_SYS_CAST (pthread_once, int, |
| 794 |
(pthread_once_t *once_control, |
| 795 |
void (*initfunction) (void))); |
| 796 |
# endif |
| 797 |
# if __GLIBC__ >= 2 |
| 798 |
_GL_CXXALIASWARN (pthread_once); |
| 799 |
# endif |
| 800 |
#elif defined GNULIB_POSIXCHECK |
| 801 |
# undef pthread_once |
| 802 |
# if HAVE_RAW_DECL_PTHREAD_ONCE |
| 803 |
_GL_WARN_ON_USE (pthread_once, "pthread_once is not portable - " |
| 804 |
"use gnulib module pthread-once for portability"); |
| 805 |
# endif |
| 806 |
#endif |
| 807 |
|
| 808 |
/* =========== Mutex functions =========== */ |
| 809 |
|
| 810 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 811 |
# if @REPLACE_PTHREAD_MUTEX_INIT@ |
| 812 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 813 |
# undef pthread_mutex_init |
| 814 |
# define pthread_mutex_init rpl_pthread_mutex_init |
| 815 |
# endif |
| 816 |
_GL_FUNCDECL_RPL (pthread_mutex_init, int, |
| 817 |
(pthread_mutex_t *restrict mutex, |
| 818 |
const pthread_mutexattr_t *restrict attr), |
| 819 |
_GL_ARG_NONNULL ((1))); |
| 820 |
_GL_CXXALIAS_RPL (pthread_mutex_init, int, |
| 821 |
(pthread_mutex_t *restrict mutex, |
| 822 |
const pthread_mutexattr_t *restrict attr)); |
| 823 |
# else |
| 824 |
# if !@HAVE_PTHREAD_MUTEX_INIT@ |
| 825 |
_GL_FUNCDECL_SYS (pthread_mutex_init, int, |
| 826 |
(pthread_mutex_t *restrict mutex, |
| 827 |
const pthread_mutexattr_t *restrict attr), |
| 828 |
_GL_ARG_NONNULL ((1))); |
| 829 |
# endif |
| 830 |
_GL_CXXALIAS_SYS (pthread_mutex_init, int, |
| 831 |
(pthread_mutex_t *restrict mutex, |
| 832 |
const pthread_mutexattr_t *restrict attr)); |
| 833 |
# endif |
| 834 |
# if __GLIBC__ >= 2 |
| 835 |
_GL_CXXALIASWARN (pthread_mutex_init); |
| 836 |
# endif |
| 837 |
#elif defined GNULIB_POSIXCHECK |
| 838 |
# undef pthread_mutex_init |
| 839 |
# if HAVE_RAW_DECL_PTHREAD_MUTEX_INIT |
| 840 |
_GL_WARN_ON_USE (pthread_mutex_init, "pthread_mutex_init is not portable - " |
| 841 |
"use gnulib module pthread-mutex for portability"); |
| 842 |
# endif |
| 843 |
#endif |
| 844 |
|
| 845 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 846 |
# if @REPLACE_PTHREAD_MUTEXATTR_INIT@ |
| 847 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 848 |
# undef pthread_mutexattr_init |
| 849 |
# define pthread_mutexattr_init rpl_pthread_mutexattr_init |
| 850 |
# endif |
| 851 |
_GL_FUNCDECL_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr), |
| 852 |
_GL_ARG_NONNULL ((1))); |
| 853 |
_GL_CXXALIAS_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)); |
| 854 |
# else |
| 855 |
# if !@HAVE_PTHREAD_MUTEXATTR_INIT@ |
| 856 |
_GL_FUNCDECL_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr), |
| 857 |
_GL_ARG_NONNULL ((1))); |
| 858 |
# endif |
| 859 |
_GL_CXXALIAS_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)); |
| 860 |
# endif |
| 861 |
# if __GLIBC__ >= 2 |
| 862 |
_GL_CXXALIASWARN (pthread_mutexattr_init); |
| 863 |
# endif |
| 864 |
#elif defined GNULIB_POSIXCHECK |
| 865 |
# undef pthread_mutexattr_init |
| 866 |
# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_INIT |
| 867 |
_GL_WARN_ON_USE (pthread_mutexattr_init, "pthread_mutexattr_init is not portable - " |
| 868 |
"use gnulib module pthread-mutex for portability"); |
| 869 |
# endif |
| 870 |
#endif |
| 871 |
|
| 872 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 873 |
# if @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@ |
| 874 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 875 |
# undef pthread_mutexattr_gettype |
| 876 |
# define pthread_mutexattr_gettype rpl_pthread_mutexattr_gettype |
| 877 |
# endif |
| 878 |
_GL_FUNCDECL_RPL (pthread_mutexattr_gettype, int, |
| 879 |
(const pthread_mutexattr_t *restrict attr, |
| 880 |
int *restrict typep), |
| 881 |
_GL_ARG_NONNULL ((1, 2))); |
| 882 |
_GL_CXXALIAS_RPL (pthread_mutexattr_gettype, int, |
| 883 |
(const pthread_mutexattr_t *restrict attr, |
| 884 |
int *restrict typep)); |
| 885 |
# else |
| 886 |
# if !@HAVE_PTHREAD_MUTEXATTR_GETTYPE@ |
| 887 |
_GL_FUNCDECL_SYS (pthread_mutexattr_gettype, int, |
| 888 |
(const pthread_mutexattr_t *restrict attr, |
| 889 |
int *restrict typep), |
| 890 |
_GL_ARG_NONNULL ((1, 2))); |
| 891 |
# endif |
| 892 |
/* Need to cast, because on FreeBSD the first parameter is |
| 893 |
pthread_mutexattr_t *attr. */ |
| 894 |
_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_gettype, int, |
| 895 |
(const pthread_mutexattr_t *restrict attr, |
| 896 |
int *restrict typep)); |
| 897 |
# endif |
| 898 |
# if __GLIBC__ >= 2 |
| 899 |
_GL_CXXALIASWARN (pthread_mutexattr_gettype); |
| 900 |
# endif |
| 901 |
#elif defined GNULIB_POSIXCHECK |
| 902 |
# undef pthread_mutexattr_gettype |
| 903 |
# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETTYPE |
| 904 |
_GL_WARN_ON_USE (pthread_mutexattr_gettype, "pthread_mutexattr_gettype is not portable - " |
| 905 |
"use gnulib module pthread-mutex for portability"); |
| 906 |
# endif |
| 907 |
#endif |
| 908 |
|
| 909 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 910 |
# if @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@ |
| 911 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 912 |
# undef pthread_mutexattr_settype |
| 913 |
# define pthread_mutexattr_settype rpl_pthread_mutexattr_settype |
| 914 |
# endif |
| 915 |
_GL_FUNCDECL_RPL (pthread_mutexattr_settype, int, |
| 916 |
(pthread_mutexattr_t *attr, int type), _GL_ARG_NONNULL ((1))); |
| 917 |
_GL_CXXALIAS_RPL (pthread_mutexattr_settype, int, |
| 918 |
(pthread_mutexattr_t *attr, int type)); |
| 919 |
# else |
| 920 |
# if !@HAVE_PTHREAD_MUTEXATTR_SETTYPE@ |
| 921 |
_GL_FUNCDECL_SYS (pthread_mutexattr_settype, int, |
| 922 |
(pthread_mutexattr_t *attr, int type), _GL_ARG_NONNULL ((1))); |
| 923 |
# endif |
| 924 |
_GL_CXXALIAS_SYS (pthread_mutexattr_settype, int, |
| 925 |
(pthread_mutexattr_t *attr, int type)); |
| 926 |
# endif |
| 927 |
# if __GLIBC__ >= 2 |
| 928 |
_GL_CXXALIASWARN (pthread_mutexattr_settype); |
| 929 |
# endif |
| 930 |
#elif defined GNULIB_POSIXCHECK |
| 931 |
# undef pthread_mutexattr_settype |
| 932 |
# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETTYPE |
| 933 |
_GL_WARN_ON_USE (pthread_mutexattr_settype, "pthread_mutexattr_settype is not portable - " |
| 934 |
"use gnulib module pthread-mutex for portability"); |
| 935 |
# endif |
| 936 |
#endif |
| 937 |
|
| 938 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 939 |
# if @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@ |
| 940 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 941 |
# undef pthread_mutexattr_getrobust |
| 942 |
# define pthread_mutexattr_getrobust rpl_pthread_mutexattr_getrobust |
| 943 |
# endif |
| 944 |
_GL_FUNCDECL_RPL (pthread_mutexattr_getrobust, int, |
| 945 |
(const pthread_mutexattr_t *restrict attr, |
| 946 |
int *restrict robustp), |
| 947 |
_GL_ARG_NONNULL ((1, 2))); |
| 948 |
_GL_CXXALIAS_RPL (pthread_mutexattr_getrobust, int, |
| 949 |
(const pthread_mutexattr_t *restrict attr, |
| 950 |
int *restrict robustp)); |
| 951 |
# else |
| 952 |
# if !@HAVE_PTHREAD_MUTEXATTR_GETROBUST@ |
| 953 |
_GL_FUNCDECL_SYS (pthread_mutexattr_getrobust, int, |
| 954 |
(const pthread_mutexattr_t *restrict attr, |
| 955 |
int *restrict robustp), |
| 956 |
_GL_ARG_NONNULL ((1, 2))); |
| 957 |
# endif |
| 958 |
/* Need to cast, because on FreeBSD the first parameter is |
| 959 |
pthread_mutexattr_t *attr. */ |
| 960 |
_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_getrobust, int, |
| 961 |
(const pthread_mutexattr_t *restrict attr, |
| 962 |
int *restrict robustp)); |
| 963 |
# endif |
| 964 |
# if __GLIBC__ >= 2 |
| 965 |
_GL_CXXALIASWARN (pthread_mutexattr_getrobust); |
| 966 |
# endif |
| 967 |
#elif defined GNULIB_POSIXCHECK |
| 968 |
# undef pthread_mutexattr_getrobust |
| 969 |
# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETROBUST |
| 970 |
_GL_WARN_ON_USE (pthread_mutexattr_getrobust, "pthread_mutexattr_getrobust is not portable - " |
| 971 |
"use gnulib module pthread-mutex for portability"); |
| 972 |
# endif |
| 973 |
#endif |
| 974 |
|
| 975 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 976 |
# if @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@ |
| 977 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 978 |
# undef pthread_mutexattr_setrobust |
| 979 |
# define pthread_mutexattr_setrobust rpl_pthread_mutexattr_setrobust |
| 980 |
# endif |
| 981 |
_GL_FUNCDECL_RPL (pthread_mutexattr_setrobust, int, |
| 982 |
(pthread_mutexattr_t *attr, int robust), |
| 983 |
_GL_ARG_NONNULL ((1))); |
| 984 |
_GL_CXXALIAS_RPL (pthread_mutexattr_setrobust, int, |
| 985 |
(pthread_mutexattr_t *attr, int robust)); |
| 986 |
# else |
| 987 |
# if !@HAVE_PTHREAD_MUTEXATTR_SETROBUST@ |
| 988 |
_GL_FUNCDECL_SYS (pthread_mutexattr_setrobust, int, |
| 989 |
(pthread_mutexattr_t *attr, int robust), |
| 990 |
_GL_ARG_NONNULL ((1))); |
| 991 |
# endif |
| 992 |
_GL_CXXALIAS_SYS (pthread_mutexattr_setrobust, int, |
| 993 |
(pthread_mutexattr_t *attr, int robust)); |
| 994 |
# endif |
| 995 |
# if __GLIBC__ >= 2 |
| 996 |
_GL_CXXALIASWARN (pthread_mutexattr_setrobust); |
| 997 |
# endif |
| 998 |
#elif defined GNULIB_POSIXCHECK |
| 999 |
# undef pthread_mutexattr_setrobust |
| 1000 |
# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETROBUST |
| 1001 |
_GL_WARN_ON_USE (pthread_mutexattr_setrobust, "pthread_mutexattr_setrobust is not portable - " |
| 1002 |
"use gnulib module pthread-mutex for portability"); |
| 1003 |
# endif |
| 1004 |
#endif |
| 1005 |
|
| 1006 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 1007 |
# if @REPLACE_PTHREAD_MUTEXATTR_DESTROY@ |
| 1008 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1009 |
# undef pthread_mutexattr_destroy |
| 1010 |
# define pthread_mutexattr_destroy rpl_pthread_mutexattr_destroy |
| 1011 |
# endif |
| 1012 |
_GL_FUNCDECL_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr), |
| 1013 |
_GL_ARG_NONNULL ((1))); |
| 1014 |
_GL_CXXALIAS_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)); |
| 1015 |
# else |
| 1016 |
# if !@HAVE_PTHREAD_MUTEXATTR_DESTROY@ |
| 1017 |
_GL_FUNCDECL_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr), |
| 1018 |
_GL_ARG_NONNULL ((1))); |
| 1019 |
# endif |
| 1020 |
_GL_CXXALIAS_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)); |
| 1021 |
# endif |
| 1022 |
# if __GLIBC__ >= 2 |
| 1023 |
_GL_CXXALIASWARN (pthread_mutexattr_destroy); |
| 1024 |
# endif |
| 1025 |
#elif defined GNULIB_POSIXCHECK |
| 1026 |
# undef pthread_mutexattr_destroy |
| 1027 |
# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_DESTROY |
| 1028 |
_GL_WARN_ON_USE (pthread_mutexattr_destroy, "pthread_mutexattr_destroy is not portable - " |
| 1029 |
"use gnulib module pthread-mutex for portability"); |
| 1030 |
# endif |
| 1031 |
#endif |
| 1032 |
|
| 1033 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 1034 |
# if @REPLACE_PTHREAD_MUTEX_LOCK@ |
| 1035 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1036 |
# undef pthread_mutex_lock |
| 1037 |
# define pthread_mutex_lock rpl_pthread_mutex_lock |
| 1038 |
# endif |
| 1039 |
_GL_FUNCDECL_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex), |
| 1040 |
_GL_ARG_NONNULL ((1))); |
| 1041 |
_GL_CXXALIAS_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex)); |
| 1042 |
# else |
| 1043 |
# if !@HAVE_PTHREAD_MUTEX_LOCK@ |
| 1044 |
_GL_FUNCDECL_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex), |
| 1045 |
_GL_ARG_NONNULL ((1))); |
| 1046 |
# endif |
| 1047 |
_GL_CXXALIAS_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex)); |
| 1048 |
# endif |
| 1049 |
# if __GLIBC__ >= 2 |
| 1050 |
_GL_CXXALIASWARN (pthread_mutex_lock); |
| 1051 |
# endif |
| 1052 |
#elif defined GNULIB_POSIXCHECK |
| 1053 |
# undef pthread_mutex_lock |
| 1054 |
# if HAVE_RAW_DECL_PTHREAD_MUTEX_LOCK |
| 1055 |
_GL_WARN_ON_USE (pthread_mutex_lock, "pthread_mutex_lock is not portable - " |
| 1056 |
"use gnulib module pthread-mutex for portability"); |
| 1057 |
# endif |
| 1058 |
#endif |
| 1059 |
|
| 1060 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 1061 |
# if @REPLACE_PTHREAD_MUTEX_TRYLOCK@ |
| 1062 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1063 |
# undef pthread_mutex_trylock |
| 1064 |
# define pthread_mutex_trylock rpl_pthread_mutex_trylock |
| 1065 |
# endif |
| 1066 |
_GL_FUNCDECL_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex), |
| 1067 |
_GL_ARG_NONNULL ((1))); |
| 1068 |
_GL_CXXALIAS_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)); |
| 1069 |
# else |
| 1070 |
# if !@HAVE_PTHREAD_MUTEX_TRYLOCK@ |
| 1071 |
_GL_FUNCDECL_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex), |
| 1072 |
_GL_ARG_NONNULL ((1))); |
| 1073 |
# endif |
| 1074 |
_GL_CXXALIAS_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)); |
| 1075 |
# endif |
| 1076 |
# if __GLIBC__ >= 2 |
| 1077 |
_GL_CXXALIASWARN (pthread_mutex_trylock); |
| 1078 |
# endif |
| 1079 |
#elif defined GNULIB_POSIXCHECK |
| 1080 |
# undef pthread_mutex_trylock |
| 1081 |
# if HAVE_RAW_DECL_PTHREAD_MUTEX_TRYLOCK |
| 1082 |
_GL_WARN_ON_USE (pthread_mutex_trylock, "pthread_mutex_trylock is not portable - " |
| 1083 |
"use gnulib module pthread-mutex for portability"); |
| 1084 |
# endif |
| 1085 |
#endif |
| 1086 |
|
| 1087 |
#if @GNULIB_PTHREAD_MUTEX_TIMEDLOCK@ |
| 1088 |
# if @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@ |
| 1089 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1090 |
# undef pthread_mutex_timedlock |
| 1091 |
# define pthread_mutex_timedlock rpl_pthread_mutex_timedlock |
| 1092 |
# endif |
| 1093 |
_GL_FUNCDECL_RPL (pthread_mutex_timedlock, int, |
| 1094 |
(pthread_mutex_t *restrict mutex, |
| 1095 |
const struct timespec *restrict abstime), |
| 1096 |
_GL_ARG_NONNULL ((1, 2))); |
| 1097 |
_GL_CXXALIAS_RPL (pthread_mutex_timedlock, int, |
| 1098 |
(pthread_mutex_t *restrict mutex, |
| 1099 |
const struct timespec *restrict abstime)); |
| 1100 |
# else |
| 1101 |
# if !@HAVE_PTHREAD_MUTEX_TIMEDLOCK@ |
| 1102 |
_GL_FUNCDECL_SYS (pthread_mutex_timedlock, int, |
| 1103 |
(pthread_mutex_t *restrict mutex, |
| 1104 |
const struct timespec *restrict abstime), |
| 1105 |
_GL_ARG_NONNULL ((1, 2))); |
| 1106 |
# endif |
| 1107 |
_GL_CXXALIAS_SYS (pthread_mutex_timedlock, int, |
| 1108 |
(pthread_mutex_t *restrict mutex, |
| 1109 |
const struct timespec *restrict abstime)); |
| 1110 |
# endif |
| 1111 |
# if __GLIBC__ >= 2 |
| 1112 |
_GL_CXXALIASWARN (pthread_mutex_timedlock); |
| 1113 |
# endif |
| 1114 |
#elif defined GNULIB_POSIXCHECK |
| 1115 |
# undef pthread_mutex_timedlock |
| 1116 |
# if HAVE_RAW_DECL_PTHREAD_MUTEX_TIMEDLOCK |
| 1117 |
_GL_WARN_ON_USE (pthread_mutex_timedlock, "pthread_mutex_timedlock is not portable - " |
| 1118 |
"use gnulib module pthread_mutex_timedlock for portability"); |
| 1119 |
# endif |
| 1120 |
#endif |
| 1121 |
|
| 1122 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 1123 |
# if @REPLACE_PTHREAD_MUTEX_UNLOCK@ |
| 1124 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1125 |
# undef pthread_mutex_unlock |
| 1126 |
# define pthread_mutex_unlock rpl_pthread_mutex_unlock |
| 1127 |
# endif |
| 1128 |
_GL_FUNCDECL_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex), |
| 1129 |
_GL_ARG_NONNULL ((1))); |
| 1130 |
_GL_CXXALIAS_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)); |
| 1131 |
# else |
| 1132 |
# if !@HAVE_PTHREAD_MUTEX_UNLOCK@ |
| 1133 |
_GL_FUNCDECL_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex), |
| 1134 |
_GL_ARG_NONNULL ((1))); |
| 1135 |
# endif |
| 1136 |
_GL_CXXALIAS_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)); |
| 1137 |
# endif |
| 1138 |
# if __GLIBC__ >= 2 |
| 1139 |
_GL_CXXALIASWARN (pthread_mutex_unlock); |
| 1140 |
# endif |
| 1141 |
#elif defined GNULIB_POSIXCHECK |
| 1142 |
# undef pthread_mutex_unlock |
| 1143 |
# if HAVE_RAW_DECL_PTHREAD_MUTEX_UNLOCK |
| 1144 |
_GL_WARN_ON_USE (pthread_mutex_unlock, "pthread_mutex_unlock is not portable - " |
| 1145 |
"use gnulib module pthread-mutex for portability"); |
| 1146 |
# endif |
| 1147 |
#endif |
| 1148 |
|
| 1149 |
#if @GNULIB_PTHREAD_MUTEX@ |
| 1150 |
# if @REPLACE_PTHREAD_MUTEX_DESTROY@ |
| 1151 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1152 |
# undef pthread_mutex_destroy |
| 1153 |
# define pthread_mutex_destroy rpl_pthread_mutex_destroy |
| 1154 |
# endif |
| 1155 |
_GL_FUNCDECL_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex), |
| 1156 |
_GL_ARG_NONNULL ((1))); |
| 1157 |
_GL_CXXALIAS_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)); |
| 1158 |
# else |
| 1159 |
# if !@HAVE_PTHREAD_MUTEX_DESTROY@ |
| 1160 |
_GL_FUNCDECL_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex), |
| 1161 |
_GL_ARG_NONNULL ((1))); |
| 1162 |
# endif |
| 1163 |
_GL_CXXALIAS_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)); |
| 1164 |
# endif |
| 1165 |
# if __GLIBC__ >= 2 |
| 1166 |
_GL_CXXALIASWARN (pthread_mutex_destroy); |
| 1167 |
# endif |
| 1168 |
#elif defined GNULIB_POSIXCHECK |
| 1169 |
# undef pthread_mutex_destroy |
| 1170 |
# if HAVE_RAW_DECL_PTHREAD_MUTEX_DESTROY |
| 1171 |
_GL_WARN_ON_USE (pthread_mutex_destroy, "pthread_mutex_destroy is not portable - " |
| 1172 |
"use gnulib module pthread-mutex for portability"); |
| 1173 |
# endif |
| 1174 |
#endif |
| 1175 |
|
| 1176 |
/* =========== Read-write lock functions =========== */ |
| 1177 |
|
| 1178 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1179 |
# if @REPLACE_PTHREAD_RWLOCK_INIT@ |
| 1180 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1181 |
# undef pthread_rwlock_init |
| 1182 |
# define pthread_rwlock_init rpl_pthread_rwlock_init |
| 1183 |
# endif |
| 1184 |
_GL_FUNCDECL_RPL (pthread_rwlock_init, int, |
| 1185 |
(pthread_rwlock_t *restrict lock, |
| 1186 |
const pthread_rwlockattr_t *restrict attr), |
| 1187 |
_GL_ARG_NONNULL ((1))); |
| 1188 |
_GL_CXXALIAS_RPL (pthread_rwlock_init, int, |
| 1189 |
(pthread_rwlock_t *restrict lock, |
| 1190 |
const pthread_rwlockattr_t *restrict attr)); |
| 1191 |
# else |
| 1192 |
# if !@HAVE_PTHREAD_RWLOCK_INIT@ |
| 1193 |
_GL_FUNCDECL_SYS (pthread_rwlock_init, int, |
| 1194 |
(pthread_rwlock_t *restrict lock, |
| 1195 |
const pthread_rwlockattr_t *restrict attr), |
| 1196 |
_GL_ARG_NONNULL ((1))); |
| 1197 |
# endif |
| 1198 |
_GL_CXXALIAS_SYS (pthread_rwlock_init, int, |
| 1199 |
(pthread_rwlock_t *restrict lock, |
| 1200 |
const pthread_rwlockattr_t *restrict attr)); |
| 1201 |
# endif |
| 1202 |
# if __GLIBC__ >= 2 |
| 1203 |
_GL_CXXALIASWARN (pthread_rwlock_init); |
| 1204 |
# endif |
| 1205 |
#elif defined GNULIB_POSIXCHECK |
| 1206 |
# undef pthread_rwlock_init |
| 1207 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCK_INIT |
| 1208 |
_GL_WARN_ON_USE (pthread_rwlock_init, "pthread_rwlock_init is not portable - " |
| 1209 |
"use gnulib module pthread-rwlock for portability"); |
| 1210 |
# endif |
| 1211 |
#endif |
| 1212 |
|
| 1213 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1214 |
# if @REPLACE_PTHREAD_RWLOCKATTR_INIT@ |
| 1215 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1216 |
# undef pthread_rwlockattr_init |
| 1217 |
# define pthread_rwlockattr_init rpl_pthread_rwlockattr_init |
| 1218 |
# endif |
| 1219 |
_GL_FUNCDECL_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr), |
| 1220 |
_GL_ARG_NONNULL ((1))); |
| 1221 |
_GL_CXXALIAS_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)); |
| 1222 |
# else |
| 1223 |
# if !@HAVE_PTHREAD_RWLOCKATTR_INIT@ |
| 1224 |
_GL_FUNCDECL_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr), |
| 1225 |
_GL_ARG_NONNULL ((1))); |
| 1226 |
# endif |
| 1227 |
_GL_CXXALIAS_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)); |
| 1228 |
# endif |
| 1229 |
# if __GLIBC__ >= 2 |
| 1230 |
_GL_CXXALIASWARN (pthread_rwlockattr_init); |
| 1231 |
# endif |
| 1232 |
#elif defined GNULIB_POSIXCHECK |
| 1233 |
# undef pthread_rwlockattr_init |
| 1234 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_INIT |
| 1235 |
_GL_WARN_ON_USE (pthread_rwlockattr_init, "pthread_rwlockattr_init is not portable - " |
| 1236 |
"use gnulib module pthread-rwlock for portability"); |
| 1237 |
# endif |
| 1238 |
#endif |
| 1239 |
|
| 1240 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1241 |
# if @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@ |
| 1242 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1243 |
# undef pthread_rwlockattr_destroy |
| 1244 |
# define pthread_rwlockattr_destroy rpl_pthread_rwlockattr_destroy |
| 1245 |
# endif |
| 1246 |
_GL_FUNCDECL_RPL (pthread_rwlockattr_destroy, int, |
| 1247 |
(pthread_rwlockattr_t *attr), _GL_ARG_NONNULL ((1))); |
| 1248 |
_GL_CXXALIAS_RPL (pthread_rwlockattr_destroy, int, |
| 1249 |
(pthread_rwlockattr_t *attr)); |
| 1250 |
# else |
| 1251 |
# if !@HAVE_PTHREAD_RWLOCKATTR_DESTROY@ |
| 1252 |
_GL_FUNCDECL_SYS (pthread_rwlockattr_destroy, int, |
| 1253 |
(pthread_rwlockattr_t *attr), _GL_ARG_NONNULL ((1))); |
| 1254 |
# endif |
| 1255 |
_GL_CXXALIAS_SYS (pthread_rwlockattr_destroy, int, |
| 1256 |
(pthread_rwlockattr_t *attr)); |
| 1257 |
# endif |
| 1258 |
# if __GLIBC__ >= 2 |
| 1259 |
_GL_CXXALIASWARN (pthread_rwlockattr_destroy); |
| 1260 |
# endif |
| 1261 |
#elif defined GNULIB_POSIXCHECK |
| 1262 |
# undef pthread_rwlockattr_destroy |
| 1263 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_DESTROY |
| 1264 |
_GL_WARN_ON_USE (pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy is not portable - " |
| 1265 |
"use gnulib module pthread-rwlock for portability"); |
| 1266 |
# endif |
| 1267 |
#endif |
| 1268 |
|
| 1269 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1270 |
# if @REPLACE_PTHREAD_RWLOCK_RDLOCK@ |
| 1271 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1272 |
# undef pthread_rwlock_rdlock |
| 1273 |
# define pthread_rwlock_rdlock rpl_pthread_rwlock_rdlock |
| 1274 |
# endif |
| 1275 |
_GL_FUNCDECL_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock), |
| 1276 |
_GL_ARG_NONNULL ((1))); |
| 1277 |
_GL_CXXALIAS_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)); |
| 1278 |
# else |
| 1279 |
# if !@HAVE_PTHREAD_RWLOCK_RDLOCK@ |
| 1280 |
_GL_FUNCDECL_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock), |
| 1281 |
_GL_ARG_NONNULL ((1))); |
| 1282 |
# endif |
| 1283 |
_GL_CXXALIAS_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)); |
| 1284 |
# endif |
| 1285 |
# if __GLIBC__ >= 2 |
| 1286 |
_GL_CXXALIASWARN (pthread_rwlock_rdlock); |
| 1287 |
# endif |
| 1288 |
#elif defined GNULIB_POSIXCHECK |
| 1289 |
# undef pthread_rwlock_rdlock |
| 1290 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCK_RDLOCK |
| 1291 |
_GL_WARN_ON_USE (pthread_rwlock_rdlock, "pthread_rwlock_rdlock is not portable - " |
| 1292 |
"use gnulib module pthread-rwlock for portability"); |
| 1293 |
# endif |
| 1294 |
#endif |
| 1295 |
|
| 1296 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1297 |
# if @REPLACE_PTHREAD_RWLOCK_WRLOCK@ |
| 1298 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1299 |
# undef pthread_rwlock_wrlock |
| 1300 |
# define pthread_rwlock_wrlock rpl_pthread_rwlock_wrlock |
| 1301 |
# endif |
| 1302 |
_GL_FUNCDECL_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock), |
| 1303 |
_GL_ARG_NONNULL ((1))); |
| 1304 |
_GL_CXXALIAS_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)); |
| 1305 |
# else |
| 1306 |
# if !@HAVE_PTHREAD_RWLOCK_WRLOCK@ |
| 1307 |
_GL_FUNCDECL_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock), |
| 1308 |
_GL_ARG_NONNULL ((1))); |
| 1309 |
# endif |
| 1310 |
_GL_CXXALIAS_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)); |
| 1311 |
# endif |
| 1312 |
# if __GLIBC__ >= 2 |
| 1313 |
_GL_CXXALIASWARN (pthread_rwlock_wrlock); |
| 1314 |
# endif |
| 1315 |
#elif defined GNULIB_POSIXCHECK |
| 1316 |
# undef pthread_rwlock_wrlock |
| 1317 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCK_WRLOCK |
| 1318 |
_GL_WARN_ON_USE (pthread_rwlock_wrlock, "pthread_rwlock_wrlock is not portable - " |
| 1319 |
"use gnulib module pthread-rwlock for portability"); |
| 1320 |
# endif |
| 1321 |
#endif |
| 1322 |
|
| 1323 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1324 |
# if @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@ |
| 1325 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1326 |
# undef pthread_rwlock_tryrdlock |
| 1327 |
# define pthread_rwlock_tryrdlock rpl_pthread_rwlock_tryrdlock |
| 1328 |
# endif |
| 1329 |
_GL_FUNCDECL_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock), |
| 1330 |
_GL_ARG_NONNULL ((1))); |
| 1331 |
_GL_CXXALIAS_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)); |
| 1332 |
# else |
| 1333 |
# if !@HAVE_PTHREAD_RWLOCK_TRYRDLOCK@ |
| 1334 |
_GL_FUNCDECL_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock), |
| 1335 |
_GL_ARG_NONNULL ((1))); |
| 1336 |
# endif |
| 1337 |
_GL_CXXALIAS_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)); |
| 1338 |
# endif |
| 1339 |
# if __GLIBC__ >= 2 |
| 1340 |
_GL_CXXALIASWARN (pthread_rwlock_tryrdlock); |
| 1341 |
# endif |
| 1342 |
#elif defined GNULIB_POSIXCHECK |
| 1343 |
# undef pthread_rwlock_tryrdlock |
| 1344 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYRDLOCK |
| 1345 |
_GL_WARN_ON_USE (pthread_rwlock_tryrdlock, "pthread_rwlock_tryrdlock is not portable - " |
| 1346 |
"use gnulib module pthread-rwlock for portability"); |
| 1347 |
# endif |
| 1348 |
#endif |
| 1349 |
|
| 1350 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1351 |
# if @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@ |
| 1352 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1353 |
# undef pthread_rwlock_trywrlock |
| 1354 |
# define pthread_rwlock_trywrlock rpl_pthread_rwlock_trywrlock |
| 1355 |
# endif |
| 1356 |
_GL_FUNCDECL_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock), |
| 1357 |
_GL_ARG_NONNULL ((1))); |
| 1358 |
_GL_CXXALIAS_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)); |
| 1359 |
# else |
| 1360 |
# if !@HAVE_PTHREAD_RWLOCK_TRYWRLOCK@ |
| 1361 |
_GL_FUNCDECL_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock), |
| 1362 |
_GL_ARG_NONNULL ((1))); |
| 1363 |
# endif |
| 1364 |
_GL_CXXALIAS_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)); |
| 1365 |
# endif |
| 1366 |
# if __GLIBC__ >= 2 |
| 1367 |
_GL_CXXALIASWARN (pthread_rwlock_trywrlock); |
| 1368 |
# endif |
| 1369 |
#elif defined GNULIB_POSIXCHECK |
| 1370 |
# undef pthread_rwlock_trywrlock |
| 1371 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYWRLOCK |
| 1372 |
_GL_WARN_ON_USE (pthread_rwlock_trywrlock, "pthread_rwlock_trywrlock is not portable - " |
| 1373 |
"use gnulib module pthread-rwlock for portability"); |
| 1374 |
# endif |
| 1375 |
#endif |
| 1376 |
|
| 1377 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1378 |
# if @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@ |
| 1379 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1380 |
# undef pthread_rwlock_timedrdlock |
| 1381 |
# define pthread_rwlock_timedrdlock rpl_pthread_rwlock_timedrdlock |
| 1382 |
# endif |
| 1383 |
_GL_FUNCDECL_RPL (pthread_rwlock_timedrdlock, int, |
| 1384 |
(pthread_rwlock_t *restrict lock, |
| 1385 |
const struct timespec *restrict abstime), |
| 1386 |
_GL_ARG_NONNULL ((1, 2))); |
| 1387 |
_GL_CXXALIAS_RPL (pthread_rwlock_timedrdlock, int, |
| 1388 |
(pthread_rwlock_t *restrict lock, |
| 1389 |
const struct timespec *restrict abstime)); |
| 1390 |
# else |
| 1391 |
# if !@HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@ |
| 1392 |
_GL_FUNCDECL_SYS (pthread_rwlock_timedrdlock, int, |
| 1393 |
(pthread_rwlock_t *restrict lock, |
| 1394 |
const struct timespec *restrict abstime), |
| 1395 |
_GL_ARG_NONNULL ((1, 2))); |
| 1396 |
# endif |
| 1397 |
_GL_CXXALIAS_SYS (pthread_rwlock_timedrdlock, int, |
| 1398 |
(pthread_rwlock_t *restrict lock, |
| 1399 |
const struct timespec *restrict abstime)); |
| 1400 |
# endif |
| 1401 |
# if __GLIBC__ >= 2 |
| 1402 |
_GL_CXXALIASWARN (pthread_rwlock_timedrdlock); |
| 1403 |
# endif |
| 1404 |
#elif defined GNULIB_POSIXCHECK |
| 1405 |
# undef pthread_rwlock_timedrdlock |
| 1406 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDRDLOCK |
| 1407 |
_GL_WARN_ON_USE (pthread_rwlock_timedrdlock, "pthread_rwlock_timedrdlock is not portable - " |
| 1408 |
"use gnulib module pthread-rwlock for portability"); |
| 1409 |
# endif |
| 1410 |
#endif |
| 1411 |
|
| 1412 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1413 |
# if @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@ |
| 1414 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1415 |
# undef pthread_rwlock_timedwrlock |
| 1416 |
# define pthread_rwlock_timedwrlock rpl_pthread_rwlock_timedwrlock |
| 1417 |
# endif |
| 1418 |
_GL_FUNCDECL_RPL (pthread_rwlock_timedwrlock, int, |
| 1419 |
(pthread_rwlock_t *restrict lock, |
| 1420 |
const struct timespec *restrict abstime), |
| 1421 |
_GL_ARG_NONNULL ((1, 2))); |
| 1422 |
_GL_CXXALIAS_RPL (pthread_rwlock_timedwrlock, int, |
| 1423 |
(pthread_rwlock_t *restrict lock, |
| 1424 |
const struct timespec *restrict abstime)); |
| 1425 |
# else |
| 1426 |
# if !@HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@ |
| 1427 |
_GL_FUNCDECL_SYS (pthread_rwlock_timedwrlock, int, |
| 1428 |
(pthread_rwlock_t *restrict lock, |
| 1429 |
const struct timespec *restrict abstime), |
| 1430 |
_GL_ARG_NONNULL ((1, 2))); |
| 1431 |
# endif |
| 1432 |
_GL_CXXALIAS_SYS (pthread_rwlock_timedwrlock, int, |
| 1433 |
(pthread_rwlock_t *restrict lock, |
| 1434 |
const struct timespec *restrict abstime)); |
| 1435 |
# endif |
| 1436 |
# if __GLIBC__ >= 2 |
| 1437 |
_GL_CXXALIASWARN (pthread_rwlock_timedwrlock); |
| 1438 |
# endif |
| 1439 |
#elif defined GNULIB_POSIXCHECK |
| 1440 |
# undef pthread_rwlock_timedwrlock |
| 1441 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDWRLOCK |
| 1442 |
_GL_WARN_ON_USE (pthread_rwlock_timedwrlock, "pthread_rwlock_timedwrlock is not portable - " |
| 1443 |
"use gnulib module pthread-rwlock for portability"); |
| 1444 |
# endif |
| 1445 |
#endif |
| 1446 |
|
| 1447 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1448 |
# if @REPLACE_PTHREAD_RWLOCK_UNLOCK@ |
| 1449 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1450 |
# undef pthread_rwlock_unlock |
| 1451 |
# define pthread_rwlock_unlock rpl_pthread_rwlock_unlock |
| 1452 |
# endif |
| 1453 |
_GL_FUNCDECL_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock), |
| 1454 |
_GL_ARG_NONNULL ((1))); |
| 1455 |
_GL_CXXALIAS_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)); |
| 1456 |
# else |
| 1457 |
# if !@HAVE_PTHREAD_RWLOCK_UNLOCK@ |
| 1458 |
_GL_FUNCDECL_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock), |
| 1459 |
_GL_ARG_NONNULL ((1))); |
| 1460 |
# endif |
| 1461 |
_GL_CXXALIAS_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)); |
| 1462 |
# endif |
| 1463 |
# if __GLIBC__ >= 2 |
| 1464 |
_GL_CXXALIASWARN (pthread_rwlock_unlock); |
| 1465 |
# endif |
| 1466 |
#elif defined GNULIB_POSIXCHECK |
| 1467 |
# undef pthread_rwlock_unlock |
| 1468 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCK_UNLOCK |
| 1469 |
_GL_WARN_ON_USE (pthread_rwlock_unlock, "pthread_rwlock_unlock is not portable - " |
| 1470 |
"use gnulib module pthread-rwlock for portability"); |
| 1471 |
# endif |
| 1472 |
#endif |
| 1473 |
|
| 1474 |
#if @GNULIB_PTHREAD_RWLOCK@ |
| 1475 |
# if @REPLACE_PTHREAD_RWLOCK_DESTROY@ |
| 1476 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1477 |
# undef pthread_rwlock_destroy |
| 1478 |
# define pthread_rwlock_destroy rpl_pthread_rwlock_destroy |
| 1479 |
# endif |
| 1480 |
_GL_FUNCDECL_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock), |
| 1481 |
_GL_ARG_NONNULL ((1))); |
| 1482 |
_GL_CXXALIAS_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)); |
| 1483 |
# else |
| 1484 |
# if !@HAVE_PTHREAD_RWLOCK_DESTROY@ |
| 1485 |
_GL_FUNCDECL_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock), |
| 1486 |
_GL_ARG_NONNULL ((1))); |
| 1487 |
# endif |
| 1488 |
_GL_CXXALIAS_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)); |
| 1489 |
# endif |
| 1490 |
# if __GLIBC__ >= 2 |
| 1491 |
_GL_CXXALIASWARN (pthread_rwlock_destroy); |
| 1492 |
# endif |
| 1493 |
#elif defined GNULIB_POSIXCHECK |
| 1494 |
# undef pthread_rwlock_destroy |
| 1495 |
# if HAVE_RAW_DECL_PTHREAD_RWLOCK_DESTROY |
| 1496 |
_GL_WARN_ON_USE (pthread_rwlock_destroy, "pthread_rwlock_destroy is not portable - " |
| 1497 |
"use gnulib module pthread-rwlock for portability"); |
| 1498 |
# endif |
| 1499 |
#endif |
| 1500 |
|
| 1501 |
/* =========== Condition variable functions =========== */ |
| 1502 |
|
| 1503 |
#if @GNULIB_PTHREAD_COND@ |
| 1504 |
# if @REPLACE_PTHREAD_COND_INIT@ |
| 1505 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1506 |
# undef pthread_cond_init |
| 1507 |
# define pthread_cond_init rpl_pthread_cond_init |
| 1508 |
# endif |
| 1509 |
_GL_FUNCDECL_RPL (pthread_cond_init, int, |
| 1510 |
(pthread_cond_t *restrict cond, |
| 1511 |
const pthread_condattr_t *restrict attr), |
| 1512 |
_GL_ARG_NONNULL ((1))); |
| 1513 |
_GL_CXXALIAS_RPL (pthread_cond_init, int, |
| 1514 |
(pthread_cond_t *restrict cond, |
| 1515 |
const pthread_condattr_t *restrict attr)); |
| 1516 |
# else |
| 1517 |
# if !@HAVE_PTHREAD_COND_INIT@ |
| 1518 |
_GL_FUNCDECL_SYS (pthread_cond_init, int, |
| 1519 |
(pthread_cond_t *restrict cond, |
| 1520 |
const pthread_condattr_t *restrict attr), |
| 1521 |
_GL_ARG_NONNULL ((1))); |
| 1522 |
# endif |
| 1523 |
_GL_CXXALIAS_SYS (pthread_cond_init, int, |
| 1524 |
(pthread_cond_t *restrict cond, |
| 1525 |
const pthread_condattr_t *restrict attr)); |
| 1526 |
# endif |
| 1527 |
# if __GLIBC__ >= 2 |
| 1528 |
_GL_CXXALIASWARN (pthread_cond_init); |
| 1529 |
# endif |
| 1530 |
#elif defined GNULIB_POSIXCHECK |
| 1531 |
# undef pthread_cond_init |
| 1532 |
# if HAVE_RAW_DECL_PTHREAD_COND_INIT |
| 1533 |
_GL_WARN_ON_USE (pthread_cond_init, "pthread_cond_init is not portable - " |
| 1534 |
"use gnulib module pthread-cond for portability"); |
| 1535 |
# endif |
| 1536 |
#endif |
| 1537 |
|
| 1538 |
#if @GNULIB_PTHREAD_COND@ |
| 1539 |
# if @REPLACE_PTHREAD_CONDATTR_INIT@ |
| 1540 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1541 |
# undef pthread_condattr_init |
| 1542 |
# define pthread_condattr_init rpl_pthread_condattr_init |
| 1543 |
# endif |
| 1544 |
_GL_FUNCDECL_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr), |
| 1545 |
_GL_ARG_NONNULL ((1))); |
| 1546 |
_GL_CXXALIAS_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr)); |
| 1547 |
# else |
| 1548 |
# if !@HAVE_PTHREAD_CONDATTR_INIT@ |
| 1549 |
_GL_FUNCDECL_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr), |
| 1550 |
_GL_ARG_NONNULL ((1))); |
| 1551 |
# endif |
| 1552 |
_GL_CXXALIAS_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr)); |
| 1553 |
# endif |
| 1554 |
# if __GLIBC__ >= 2 |
| 1555 |
_GL_CXXALIASWARN (pthread_condattr_init); |
| 1556 |
# endif |
| 1557 |
#elif defined GNULIB_POSIXCHECK |
| 1558 |
# undef pthread_condattr_init |
| 1559 |
# if HAVE_RAW_DECL_PTHREAD_CONDATTR_INIT |
| 1560 |
_GL_WARN_ON_USE (pthread_condattr_init, "pthread_condattr_init is not portable - " |
| 1561 |
"use gnulib module pthread-cond for portability"); |
| 1562 |
# endif |
| 1563 |
#endif |
| 1564 |
|
| 1565 |
#if @GNULIB_PTHREAD_COND@ |
| 1566 |
# if @REPLACE_PTHREAD_CONDATTR_DESTROY@ |
| 1567 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1568 |
# undef pthread_condattr_destroy |
| 1569 |
# define pthread_condattr_destroy rpl_pthread_condattr_destroy |
| 1570 |
# endif |
| 1571 |
_GL_FUNCDECL_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr), |
| 1572 |
_GL_ARG_NONNULL ((1))); |
| 1573 |
_GL_CXXALIAS_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr)); |
| 1574 |
# else |
| 1575 |
# if !@HAVE_PTHREAD_CONDATTR_DESTROY@ |
| 1576 |
_GL_FUNCDECL_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr), |
| 1577 |
_GL_ARG_NONNULL ((1))); |
| 1578 |
# endif |
| 1579 |
_GL_CXXALIAS_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr)); |
| 1580 |
# endif |
| 1581 |
# if __GLIBC__ >= 2 |
| 1582 |
_GL_CXXALIASWARN (pthread_condattr_destroy); |
| 1583 |
# endif |
| 1584 |
#elif defined GNULIB_POSIXCHECK |
| 1585 |
# undef pthread_condattr_destroy |
| 1586 |
# if HAVE_RAW_DECL_PTHREAD_CONDATTR_DESTROY |
| 1587 |
_GL_WARN_ON_USE (pthread_condattr_destroy, "pthread_condattr_destroy is not portable - " |
| 1588 |
"use gnulib module pthread-cond for portability"); |
| 1589 |
# endif |
| 1590 |
#endif |
| 1591 |
|
| 1592 |
#if @GNULIB_PTHREAD_COND@ |
| 1593 |
# if @REPLACE_PTHREAD_COND_WAIT@ |
| 1594 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1595 |
# undef pthread_cond_wait |
| 1596 |
# define pthread_cond_wait rpl_pthread_cond_wait |
| 1597 |
# endif |
| 1598 |
_GL_FUNCDECL_RPL (pthread_cond_wait, int, |
| 1599 |
(pthread_cond_t *restrict cond, |
| 1600 |
pthread_mutex_t *restrict mutex), |
| 1601 |
_GL_ARG_NONNULL ((1, 2))); |
| 1602 |
_GL_CXXALIAS_RPL (pthread_cond_wait, int, |
| 1603 |
(pthread_cond_t *restrict cond, |
| 1604 |
pthread_mutex_t *restrict mutex)); |
| 1605 |
# else |
| 1606 |
# if !@HAVE_PTHREAD_COND_WAIT@ |
| 1607 |
_GL_FUNCDECL_SYS (pthread_cond_wait, int, |
| 1608 |
(pthread_cond_t *restrict cond, |
| 1609 |
pthread_mutex_t *restrict mutex), |
| 1610 |
_GL_ARG_NONNULL ((1, 2))); |
| 1611 |
# endif |
| 1612 |
_GL_CXXALIAS_SYS (pthread_cond_wait, int, |
| 1613 |
(pthread_cond_t *restrict cond, |
| 1614 |
pthread_mutex_t *restrict mutex)); |
| 1615 |
# endif |
| 1616 |
# if __GLIBC__ >= 2 |
| 1617 |
_GL_CXXALIASWARN (pthread_cond_wait); |
| 1618 |
# endif |
| 1619 |
#elif defined GNULIB_POSIXCHECK |
| 1620 |
# undef pthread_cond_wait |
| 1621 |
# if HAVE_RAW_DECL_PTHREAD_COND_WAIT |
| 1622 |
_GL_WARN_ON_USE (pthread_cond_wait, "pthread_cond_wait is not portable - " |
| 1623 |
"use gnulib module pthread-cond for portability"); |
| 1624 |
# endif |
| 1625 |
#endif |
| 1626 |
|
| 1627 |
#if @GNULIB_PTHREAD_COND@ |
| 1628 |
# if @REPLACE_PTHREAD_COND_TIMEDWAIT@ |
| 1629 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1630 |
# undef pthread_cond_timedwait |
| 1631 |
# define pthread_cond_timedwait rpl_pthread_cond_timedwait |
| 1632 |
# endif |
| 1633 |
_GL_FUNCDECL_RPL (pthread_cond_timedwait, int, |
| 1634 |
(pthread_cond_t *restrict cond, |
| 1635 |
pthread_mutex_t *restrict mutex, |
| 1636 |
const struct timespec *restrict abstime), |
| 1637 |
_GL_ARG_NONNULL ((1, 2, 3))); |
| 1638 |
_GL_CXXALIAS_RPL (pthread_cond_timedwait, int, |
| 1639 |
(pthread_cond_t *restrict cond, |
| 1640 |
pthread_mutex_t *restrict mutex, |
| 1641 |
const struct timespec *restrict abstime)); |
| 1642 |
# else |
| 1643 |
# if !@HAVE_PTHREAD_COND_TIMEDWAIT@ |
| 1644 |
_GL_FUNCDECL_SYS (pthread_cond_timedwait, int, |
| 1645 |
(pthread_cond_t *restrict cond, |
| 1646 |
pthread_mutex_t *restrict mutex, |
| 1647 |
const struct timespec *restrict abstime), |
| 1648 |
_GL_ARG_NONNULL ((1, 2, 3))); |
| 1649 |
# endif |
| 1650 |
_GL_CXXALIAS_SYS (pthread_cond_timedwait, int, |
| 1651 |
(pthread_cond_t *restrict cond, |
| 1652 |
pthread_mutex_t *restrict mutex, |
| 1653 |
const struct timespec *restrict abstime)); |
| 1654 |
# endif |
| 1655 |
# if __GLIBC__ >= 2 |
| 1656 |
_GL_CXXALIASWARN (pthread_cond_timedwait); |
| 1657 |
# endif |
| 1658 |
#elif defined GNULIB_POSIXCHECK |
| 1659 |
# undef pthread_cond_timedwait |
| 1660 |
# if HAVE_RAW_DECL_PTHREAD_COND_TIMEDWAIT |
| 1661 |
_GL_WARN_ON_USE (pthread_cond_timedwait, "pthread_cond_timedwait is not portable - " |
| 1662 |
"use gnulib module pthread-cond for portability"); |
| 1663 |
# endif |
| 1664 |
#endif |
| 1665 |
|
| 1666 |
#if @GNULIB_PTHREAD_COND@ |
| 1667 |
# if @REPLACE_PTHREAD_COND_SIGNAL@ |
| 1668 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1669 |
# undef pthread_cond_signal |
| 1670 |
# define pthread_cond_signal rpl_pthread_cond_signal |
| 1671 |
# endif |
| 1672 |
_GL_FUNCDECL_RPL (pthread_cond_signal, int, (pthread_cond_t *cond), |
| 1673 |
_GL_ARG_NONNULL ((1))); |
| 1674 |
_GL_CXXALIAS_RPL (pthread_cond_signal, int, (pthread_cond_t *cond)); |
| 1675 |
# else |
| 1676 |
# if !@HAVE_PTHREAD_COND_SIGNAL@ |
| 1677 |
_GL_FUNCDECL_SYS (pthread_cond_signal, int, (pthread_cond_t *cond), |
| 1678 |
_GL_ARG_NONNULL ((1))); |
| 1679 |
# endif |
| 1680 |
_GL_CXXALIAS_SYS (pthread_cond_signal, int, (pthread_cond_t *cond)); |
| 1681 |
# endif |
| 1682 |
# if __GLIBC__ >= 2 |
| 1683 |
_GL_CXXALIASWARN (pthread_cond_signal); |
| 1684 |
# endif |
| 1685 |
#elif defined GNULIB_POSIXCHECK |
| 1686 |
# undef pthread_cond_signal |
| 1687 |
# if HAVE_RAW_DECL_PTHREAD_COND_SIGNAL |
| 1688 |
_GL_WARN_ON_USE (pthread_cond_signal, "pthread_cond_signal is not portable - " |
| 1689 |
"use gnulib module pthread-cond for portability"); |
| 1690 |
# endif |
| 1691 |
#endif |
| 1692 |
|
| 1693 |
#if @GNULIB_PTHREAD_COND@ |
| 1694 |
# if @REPLACE_PTHREAD_COND_BROADCAST@ |
| 1695 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1696 |
# undef pthread_cond_broadcast |
| 1697 |
# define pthread_cond_broadcast rpl_pthread_cond_broadcast |
| 1698 |
# endif |
| 1699 |
_GL_FUNCDECL_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond), |
| 1700 |
_GL_ARG_NONNULL ((1))); |
| 1701 |
_GL_CXXALIAS_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond)); |
| 1702 |
# else |
| 1703 |
# if !@HAVE_PTHREAD_COND_BROADCAST@ |
| 1704 |
_GL_FUNCDECL_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond), |
| 1705 |
_GL_ARG_NONNULL ((1))); |
| 1706 |
# endif |
| 1707 |
_GL_CXXALIAS_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond)); |
| 1708 |
# endif |
| 1709 |
# if __GLIBC__ >= 2 |
| 1710 |
_GL_CXXALIASWARN (pthread_cond_broadcast); |
| 1711 |
# endif |
| 1712 |
#elif defined GNULIB_POSIXCHECK |
| 1713 |
# undef pthread_cond_broadcast |
| 1714 |
# if HAVE_RAW_DECL_PTHREAD_COND_BROADCAST |
| 1715 |
_GL_WARN_ON_USE (pthread_cond_broadcast, "pthread_cond_broadcast is not portable - " |
| 1716 |
"use gnulib module pthread-cond for portability"); |
| 1717 |
# endif |
| 1718 |
#endif |
| 1719 |
|
| 1720 |
#if @GNULIB_PTHREAD_COND@ |
| 1721 |
# if @REPLACE_PTHREAD_COND_DESTROY@ |
| 1722 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1723 |
# undef pthread_cond_destroy |
| 1724 |
# define pthread_cond_destroy rpl_pthread_cond_destroy |
| 1725 |
# endif |
| 1726 |
_GL_FUNCDECL_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond), |
| 1727 |
_GL_ARG_NONNULL ((1))); |
| 1728 |
_GL_CXXALIAS_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond)); |
| 1729 |
# else |
| 1730 |
# if !@HAVE_PTHREAD_COND_DESTROY@ |
| 1731 |
_GL_FUNCDECL_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond), |
| 1732 |
_GL_ARG_NONNULL ((1))); |
| 1733 |
# endif |
| 1734 |
_GL_CXXALIAS_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond)); |
| 1735 |
# endif |
| 1736 |
# if __GLIBC__ >= 2 |
| 1737 |
_GL_CXXALIASWARN (pthread_cond_destroy); |
| 1738 |
# endif |
| 1739 |
#elif defined GNULIB_POSIXCHECK |
| 1740 |
# undef pthread_cond_destroy |
| 1741 |
# if HAVE_RAW_DECL_PTHREAD_COND_DESTROY |
| 1742 |
_GL_WARN_ON_USE (pthread_cond_destroy, "pthread_cond_destroy is not portable - " |
| 1743 |
"use gnulib module pthread-cond for portability"); |
| 1744 |
# endif |
| 1745 |
#endif |
| 1746 |
|
| 1747 |
/* =========== Thread-specific storage functions =========== */ |
| 1748 |
|
| 1749 |
#if @GNULIB_PTHREAD_TSS@ |
| 1750 |
# if @REPLACE_PTHREAD_KEY_CREATE@ |
| 1751 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1752 |
# undef pthread_key_create |
| 1753 |
# define pthread_key_create rpl_pthread_key_create |
| 1754 |
# endif |
| 1755 |
_GL_FUNCDECL_RPL (pthread_key_create, int, |
| 1756 |
(pthread_key_t *keyp, void (*destructor) (void *)), |
| 1757 |
_GL_ARG_NONNULL ((1))); |
| 1758 |
_GL_CXXALIAS_RPL (pthread_key_create, int, |
| 1759 |
(pthread_key_t *keyp, void (*destructor) (void *))); |
| 1760 |
# else |
| 1761 |
# if !@HAVE_PTHREAD_KEY_CREATE@ |
| 1762 |
_GL_FUNCDECL_SYS (pthread_key_create, int, |
| 1763 |
(pthread_key_t *keyp, void (*destructor) (void *)), |
| 1764 |
_GL_ARG_NONNULL ((1))); |
| 1765 |
# endif |
| 1766 |
_GL_CXXALIAS_SYS_CAST (pthread_key_create, int, |
| 1767 |
(pthread_key_t *keyp, void (*destructor) (void *))); |
| 1768 |
# endif |
| 1769 |
# if __GLIBC__ >= 2 |
| 1770 |
_GL_CXXALIASWARN (pthread_key_create); |
| 1771 |
# endif |
| 1772 |
#elif defined GNULIB_POSIXCHECK |
| 1773 |
# undef pthread_key_create |
| 1774 |
# if HAVE_RAW_DECL_PTHREAD_KEY_CREATE |
| 1775 |
_GL_WARN_ON_USE (pthread_key_create, "pthread_key_create is not portable - " |
| 1776 |
"use gnulib module pthread-tss for portability"); |
| 1777 |
# endif |
| 1778 |
#endif |
| 1779 |
|
| 1780 |
#if @GNULIB_PTHREAD_TSS@ |
| 1781 |
# if @REPLACE_PTHREAD_SETSPECIFIC@ |
| 1782 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1783 |
# undef pthread_setspecific |
| 1784 |
# define pthread_setspecific rpl_pthread_setspecific |
| 1785 |
# endif |
| 1786 |
_GL_FUNCDECL_RPL (pthread_setspecific, int, |
| 1787 |
(pthread_key_t key, const void *value), ); |
| 1788 |
_GL_CXXALIAS_RPL (pthread_setspecific, int, |
| 1789 |
(pthread_key_t key, const void *value)); |
| 1790 |
# else |
| 1791 |
# if !@HAVE_PTHREAD_SETSPECIFIC@ |
| 1792 |
_GL_FUNCDECL_SYS (pthread_setspecific, int, |
| 1793 |
(pthread_key_t key, const void *value), ); |
| 1794 |
# endif |
| 1795 |
_GL_CXXALIAS_SYS (pthread_setspecific, int, |
| 1796 |
(pthread_key_t key, const void *value)); |
| 1797 |
# endif |
| 1798 |
# if __GLIBC__ >= 2 |
| 1799 |
_GL_CXXALIASWARN (pthread_setspecific); |
| 1800 |
# endif |
| 1801 |
#elif defined GNULIB_POSIXCHECK |
| 1802 |
# undef pthread_setspecific |
| 1803 |
# if HAVE_RAW_DECL_PTHREAD_SETSPECIFIC |
| 1804 |
_GL_WARN_ON_USE (pthread_setspecific, "pthread_setspecific is not portable - " |
| 1805 |
"use gnulib module pthread-tss for portability"); |
| 1806 |
# endif |
| 1807 |
#endif |
| 1808 |
|
| 1809 |
#if @GNULIB_PTHREAD_TSS@ |
| 1810 |
# if @REPLACE_PTHREAD_GETSPECIFIC@ |
| 1811 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1812 |
# undef pthread_getspecific |
| 1813 |
# define pthread_getspecific rpl_pthread_getspecific |
| 1814 |
# endif |
| 1815 |
_GL_FUNCDECL_RPL (pthread_getspecific, void *, (pthread_key_t key), ); |
| 1816 |
_GL_CXXALIAS_RPL (pthread_getspecific, void *, (pthread_key_t key)); |
| 1817 |
# else |
| 1818 |
# if !@HAVE_PTHREAD_GETSPECIFIC@ |
| 1819 |
_GL_FUNCDECL_SYS (pthread_getspecific, void *, (pthread_key_t key), ); |
| 1820 |
# endif |
| 1821 |
_GL_CXXALIAS_SYS (pthread_getspecific, void *, (pthread_key_t key)); |
| 1822 |
# endif |
| 1823 |
# if __GLIBC__ >= 2 |
| 1824 |
_GL_CXXALIASWARN (pthread_getspecific); |
| 1825 |
# endif |
| 1826 |
#elif defined GNULIB_POSIXCHECK |
| 1827 |
# undef pthread_getspecific |
| 1828 |
# if HAVE_RAW_DECL_PTHREAD_GETSPECIFIC |
| 1829 |
_GL_WARN_ON_USE (pthread_getspecific, "pthread_getspecific is not portable - " |
| 1830 |
"use gnulib module pthread-tss for portability"); |
| 1831 |
# endif |
| 1832 |
#endif |
| 1833 |
|
| 1834 |
#if @GNULIB_PTHREAD_TSS@ |
| 1835 |
# if @REPLACE_PTHREAD_KEY_DELETE@ |
| 1836 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1837 |
# undef pthread_key_delete |
| 1838 |
# define pthread_key_delete rpl_pthread_key_delete |
| 1839 |
# endif |
| 1840 |
_GL_FUNCDECL_RPL (pthread_key_delete, int, (pthread_key_t key), ); |
| 1841 |
_GL_CXXALIAS_RPL (pthread_key_delete, int, (pthread_key_t key)); |
| 1842 |
# else |
| 1843 |
# if !@HAVE_PTHREAD_KEY_DELETE@ |
| 1844 |
_GL_FUNCDECL_SYS (pthread_key_delete, int, (pthread_key_t key), ); |
| 1845 |
# endif |
| 1846 |
_GL_CXXALIAS_SYS (pthread_key_delete, int, (pthread_key_t key)); |
| 1847 |
# endif |
| 1848 |
# if __GLIBC__ >= 2 |
| 1849 |
_GL_CXXALIASWARN (pthread_key_delete); |
| 1850 |
# endif |
| 1851 |
#elif defined GNULIB_POSIXCHECK |
| 1852 |
# undef pthread_key_delete |
| 1853 |
# if HAVE_RAW_DECL_PTHREAD_KEY_DELETE |
| 1854 |
_GL_WARN_ON_USE (pthread_key_delete, "pthread_key_delete is not portable - " |
| 1855 |
"use gnulib module pthread-tss for portability"); |
| 1856 |
# endif |
| 1857 |
#endif |
| 1858 |
|
| 1859 |
/* =========== Spinlock functions =========== */ |
| 1860 |
|
| 1861 |
#if @GNULIB_PTHREAD_SPIN@ |
| 1862 |
# if @REPLACE_PTHREAD_SPIN_INIT@ |
| 1863 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1864 |
# undef pthread_spin_init |
| 1865 |
# define pthread_spin_init rpl_pthread_spin_init |
| 1866 |
# endif |
| 1867 |
_GL_FUNCDECL_RPL (pthread_spin_init, int, |
| 1868 |
(pthread_spinlock_t *lock, int shared_across_processes), |
| 1869 |
_GL_ARG_NONNULL ((1))); |
| 1870 |
_GL_CXXALIAS_RPL (pthread_spin_init, int, |
| 1871 |
(pthread_spinlock_t *lock, int shared_across_processes)); |
| 1872 |
# else |
| 1873 |
# if !@HAVE_PTHREAD_SPIN_INIT@ |
| 1874 |
_GL_FUNCDECL_SYS (pthread_spin_init, int, |
| 1875 |
(pthread_spinlock_t *lock, int shared_across_processes), |
| 1876 |
_GL_ARG_NONNULL ((1))); |
| 1877 |
# endif |
| 1878 |
_GL_CXXALIAS_SYS (pthread_spin_init, int, |
| 1879 |
(pthread_spinlock_t *lock, int shared_across_processes)); |
| 1880 |
# endif |
| 1881 |
# if __GLIBC__ >= 2 |
| 1882 |
_GL_CXXALIASWARN (pthread_spin_init); |
| 1883 |
# endif |
| 1884 |
#elif defined GNULIB_POSIXCHECK |
| 1885 |
# undef pthread_spin_init |
| 1886 |
# if HAVE_RAW_DECL_PTHREAD_SPIN_INIT |
| 1887 |
_GL_WARN_ON_USE (pthread_spin_init, "pthread_spin_init is not portable - " |
| 1888 |
"use gnulib module pthread-spin for portability"); |
| 1889 |
# endif |
| 1890 |
#endif |
| 1891 |
|
| 1892 |
#if @GNULIB_PTHREAD_SPIN@ |
| 1893 |
# if @REPLACE_PTHREAD_SPIN_LOCK@ |
| 1894 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1895 |
# undef pthread_spin_lock |
| 1896 |
# define pthread_spin_lock rpl_pthread_spin_lock |
| 1897 |
# endif |
| 1898 |
_GL_FUNCDECL_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock), |
| 1899 |
_GL_ARG_NONNULL ((1))); |
| 1900 |
_GL_CXXALIAS_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock)); |
| 1901 |
# else |
| 1902 |
# if !@HAVE_PTHREAD_SPIN_LOCK@ |
| 1903 |
_GL_FUNCDECL_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock), |
| 1904 |
_GL_ARG_NONNULL ((1))); |
| 1905 |
# endif |
| 1906 |
_GL_CXXALIAS_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock)); |
| 1907 |
# endif |
| 1908 |
# if __GLIBC__ >= 2 |
| 1909 |
_GL_CXXALIASWARN (pthread_spin_lock); |
| 1910 |
# endif |
| 1911 |
#elif defined GNULIB_POSIXCHECK |
| 1912 |
# undef pthread_spin_lock |
| 1913 |
# if HAVE_RAW_DECL_PTHREAD_SPIN_LOCK |
| 1914 |
_GL_WARN_ON_USE (pthread_spin_lock, "pthread_spin_lock is not portable - " |
| 1915 |
"use gnulib module pthread-spin for portability"); |
| 1916 |
# endif |
| 1917 |
#endif |
| 1918 |
|
| 1919 |
#if @GNULIB_PTHREAD_SPIN@ |
| 1920 |
# if @REPLACE_PTHREAD_SPIN_TRYLOCK@ |
| 1921 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1922 |
# undef pthread_spin_trylock |
| 1923 |
# define pthread_spin_trylock rpl_pthread_spin_trylock |
| 1924 |
# endif |
| 1925 |
_GL_FUNCDECL_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock), |
| 1926 |
_GL_ARG_NONNULL ((1))); |
| 1927 |
_GL_CXXALIAS_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock)); |
| 1928 |
# else |
| 1929 |
# if !@HAVE_PTHREAD_SPIN_TRYLOCK@ |
| 1930 |
_GL_FUNCDECL_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock), |
| 1931 |
_GL_ARG_NONNULL ((1))); |
| 1932 |
# endif |
| 1933 |
_GL_CXXALIAS_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock)); |
| 1934 |
# endif |
| 1935 |
# if __GLIBC__ >= 2 |
| 1936 |
_GL_CXXALIASWARN (pthread_spin_trylock); |
| 1937 |
# endif |
| 1938 |
#elif defined GNULIB_POSIXCHECK |
| 1939 |
# undef pthread_spin_trylock |
| 1940 |
# if HAVE_RAW_DECL_PTHREAD_SPIN_TRYLOCK |
| 1941 |
_GL_WARN_ON_USE (pthread_spin_trylock, "pthread_spin_trylock is not portable - " |
| 1942 |
"use gnulib module pthread-spin for portability"); |
| 1943 |
# endif |
| 1944 |
#endif |
| 1945 |
|
| 1946 |
#if @GNULIB_PTHREAD_SPIN@ |
| 1947 |
# if @REPLACE_PTHREAD_SPIN_UNLOCK@ |
| 1948 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1949 |
# undef pthread_spin_unlock |
| 1950 |
# define pthread_spin_unlock rpl_pthread_spin_unlock |
| 1951 |
# endif |
| 1952 |
_GL_FUNCDECL_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock), |
| 1953 |
_GL_ARG_NONNULL ((1))); |
| 1954 |
_GL_CXXALIAS_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock)); |
| 1955 |
# else |
| 1956 |
# if !@HAVE_PTHREAD_SPIN_UNLOCK@ |
| 1957 |
_GL_FUNCDECL_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock), |
| 1958 |
_GL_ARG_NONNULL ((1))); |
| 1959 |
# endif |
| 1960 |
_GL_CXXALIAS_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock)); |
| 1961 |
# endif |
| 1962 |
# if __GLIBC__ >= 2 |
| 1963 |
_GL_CXXALIASWARN (pthread_spin_unlock); |
| 1964 |
# endif |
| 1965 |
#elif defined GNULIB_POSIXCHECK |
| 1966 |
# undef pthread_spin_unlock |
| 1967 |
# if HAVE_RAW_DECL_PTHREAD_SPIN_UNLOCK |
| 1968 |
_GL_WARN_ON_USE (pthread_spin_unlock, "pthread_spin_unlock is not portable - " |
| 1969 |
"use gnulib module pthread-spin for portability"); |
| 1970 |
# endif |
| 1971 |
#endif |
| 1972 |
|
| 1973 |
#if @GNULIB_PTHREAD_SPIN@ |
| 1974 |
# if @REPLACE_PTHREAD_SPIN_DESTROY@ |
| 1975 |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 1976 |
# undef pthread_spin_destroy |
| 1977 |
# define pthread_spin_destroy rpl_pthread_spin_destroy |
| 1978 |
# endif |
| 1979 |
_GL_FUNCDECL_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock), |
| 1980 |
_GL_ARG_NONNULL ((1))); |
| 1981 |
_GL_CXXALIAS_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock)); |
| 1982 |
# else |
| 1983 |
# if !@HAVE_PTHREAD_SPIN_DESTROY@ |
| 1984 |
_GL_FUNCDECL_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock), |
| 1985 |
_GL_ARG_NONNULL ((1))); |
| 1986 |
# endif |
| 1987 |
_GL_CXXALIAS_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock)); |
| 1988 |
# endif |
| 1989 |
# if __GLIBC__ >= 2 |
| 1990 |
_GL_CXXALIASWARN (pthread_spin_destroy); |
| 1991 |
# endif |
| 1992 |
#elif defined GNULIB_POSIXCHECK |
| 1993 |
# undef pthread_spin_destroy |
| 1994 |
# if HAVE_RAW_DECL_PTHREAD_SPIN_DESTROY |
| 1995 |
_GL_WARN_ON_USE (pthread_spin_destroy, "pthread_spin_destroy is not portable - " |
| 1996 |
"use gnulib module pthread-spin for portability"); |
| 1997 |
# endif |
| 1998 |
#endif |
| 1999 |
|
| 2000 |
|
| 2001 |
#if defined __cplusplus && defined GNULIB_NAMESPACE && !@HAVE_PTHREAD_H@ && defined __MINGW32__ |
| 2002 |
/* Provide the symbols required by mingw's <bits/gthr-default.h>. */ |
| 2003 |
using GNULIB_NAMESPACE::pthread_create; |
| 2004 |
using GNULIB_NAMESPACE::pthread_self; |
| 2005 |
using GNULIB_NAMESPACE::pthread_equal; |
| 2006 |
using GNULIB_NAMESPACE::pthread_detach; |
| 2007 |
using GNULIB_NAMESPACE::pthread_join; |
| 2008 |
using GNULIB_NAMESPACE::pthread_once; |
| 2009 |
using GNULIB_NAMESPACE::pthread_mutex_init; |
| 2010 |
using GNULIB_NAMESPACE::pthread_mutexattr_init; |
| 2011 |
using GNULIB_NAMESPACE::pthread_mutexattr_settype; |
| 2012 |
using GNULIB_NAMESPACE::pthread_mutexattr_destroy; |
| 2013 |
using GNULIB_NAMESPACE::pthread_mutex_lock; |
| 2014 |
using GNULIB_NAMESPACE::pthread_mutex_trylock; |
| 2015 |
using GNULIB_NAMESPACE::pthread_mutex_timedlock; |
| 2016 |
using GNULIB_NAMESPACE::pthread_mutex_unlock; |
| 2017 |
using GNULIB_NAMESPACE::pthread_mutex_destroy; |
| 2018 |
using GNULIB_NAMESPACE::pthread_cond_wait; |
| 2019 |
using GNULIB_NAMESPACE::pthread_cond_timedwait; |
| 2020 |
using GNULIB_NAMESPACE::pthread_cond_signal; |
| 2021 |
using GNULIB_NAMESPACE::pthread_cond_broadcast; |
| 2022 |
using GNULIB_NAMESPACE::pthread_cond_destroy; |
| 2023 |
using GNULIB_NAMESPACE::pthread_key_create; |
| 2024 |
using GNULIB_NAMESPACE::pthread_setspecific; |
| 2025 |
using GNULIB_NAMESPACE::pthread_getspecific; |
| 2026 |
using GNULIB_NAMESPACE::pthread_key_delete; |
| 2027 |
#endif |
| 2028 |
|
| 2029 |
|
| 2030 |
#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */ |
| 2031 |
#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */ |
| 2032 |
#endif |