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