1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138 |
- #ifndef _PTHREAD_H
- #define _PTHREAD_H 1
- #include <features.h>
- #include <endian.h>
- #include <sched.h>
- #include <time.h>
- #define __need_sigset_t
- #include <signal.h>
- #include <bits/pthreadtypes.h>
- #include <bits/setjmp.h>
- #include <bits/wordsize.h>
- #if defined _LIBC && ( defined IS_IN_libc || defined NOT_IN_libc )
- #include <bits/uClibc_pthread.h>
- #endif
- enum
- {
- PTHREAD_CREATE_JOINABLE,
- #define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE
- PTHREAD_CREATE_DETACHED
- #define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED
- };
- enum
- {
- PTHREAD_MUTEX_TIMED_NP,
- PTHREAD_MUTEX_RECURSIVE_NP,
- PTHREAD_MUTEX_ERRORCHECK_NP,
- PTHREAD_MUTEX_ADAPTIVE_NP
- #if defined __USE_UNIX98 || defined __USE_XOPEN2K8
- ,
- PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
- PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
- PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
- PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
- #endif
- #ifdef __USE_GNU
-
- , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP
- #endif
- };
- #ifdef __USE_XOPEN2K
- enum
- {
- PTHREAD_MUTEX_STALLED,
- PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
- PTHREAD_MUTEX_ROBUST,
- PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
- };
- #endif
- #ifdef __USE_UNIX98
- enum
- {
- PTHREAD_PRIO_NONE,
- PTHREAD_PRIO_INHERIT,
- PTHREAD_PRIO_PROTECT
- };
- #endif
- #if __WORDSIZE == 64
- # define PTHREAD_MUTEX_INITIALIZER \
- { { 0, 0, 0, 0, 0, 0, { 0, 0 } } }
- # ifdef __USE_GNU
- # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0, 0 } } }
- # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0, 0 } } }
- # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0, 0 } } }
- # endif
- #else
- # define PTHREAD_MUTEX_INITIALIZER \
- { { 0, 0, 0, 0, 0, { 0 } } }
- # ifdef __USE_GNU
- # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0 } } }
- # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0 } } }
- # define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0 } } }
- # endif
- #endif
- #if defined __USE_UNIX98 || defined __USE_XOPEN2K
- enum
- {
- PTHREAD_RWLOCK_PREFER_READER_NP,
- PTHREAD_RWLOCK_PREFER_WRITER_NP,
- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
- PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
- };
- # define PTHREAD_RWLOCK_INITIALIZER \
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
- # ifdef __USE_GNU
- # if __WORDSIZE == 64
- # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
- # else
- # if __BYTE_ORDER == __LITTLE_ENDIAN
- # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
- { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \
- 0, 0, 0, 0 } }
- # else
- # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
- { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\
- 0 } }
- # endif
- # endif
- # endif
- #endif
- enum
- {
- PTHREAD_INHERIT_SCHED,
- #define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED
- PTHREAD_EXPLICIT_SCHED
- #define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED
- };
- enum
- {
- PTHREAD_SCOPE_SYSTEM,
- #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM
- PTHREAD_SCOPE_PROCESS
- #define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS
- };
- enum
- {
- PTHREAD_PROCESS_PRIVATE,
- #define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE
- PTHREAD_PROCESS_SHARED
- #define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED
- };
- #define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }
- struct _pthread_cleanup_buffer
- {
- void (*__routine) (void *);
- void *__arg;
- int __canceltype;
- struct _pthread_cleanup_buffer *__prev;
- };
- enum
- {
- PTHREAD_CANCEL_ENABLE,
- #define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE
- PTHREAD_CANCEL_DISABLE
- #define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE
- };
- enum
- {
- PTHREAD_CANCEL_DEFERRED,
- #define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED
- PTHREAD_CANCEL_ASYNCHRONOUS
- #define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS
- };
- #define PTHREAD_CANCELED ((void *) -1)
- #define PTHREAD_ONCE_INIT 0
- #ifdef __USE_XOPEN2K
- # define PTHREAD_BARRIER_SERIAL_THREAD -1
- #endif
- __BEGIN_DECLS
- extern int pthread_create (pthread_t *__restrict __newthread,
- __const pthread_attr_t *__restrict __attr,
- void *(*__start_routine) (void *),
- void *__restrict __arg) __THROW __nonnull ((1, 3));
- extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
- extern int pthread_join (pthread_t __th, void **__thread_return);
- #ifdef __USE_GNU
- extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
- extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
- __const struct timespec *__abstime);
- #endif
- extern int pthread_detach (pthread_t __th) __THROW;
- extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__));
- extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW;
- extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1));
- extern int pthread_attr_destroy (pthread_attr_t *__attr)
- __THROW __nonnull ((1));
- extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
- int *__detachstate)
- __THROW __nonnull ((1, 2));
- extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
- int __detachstate)
- __THROW __nonnull ((1));
- extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
- size_t *__guardsize)
- __THROW __nonnull ((1, 2));
- extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
- size_t __guardsize)
- __THROW __nonnull ((1));
- extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
- __attr,
- struct sched_param *__restrict __param)
- __THROW __nonnull ((1, 2));
- extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
- __const struct sched_param *__restrict
- __param) __THROW __nonnull ((1, 2));
- extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
- __attr, int *__restrict __policy)
- __THROW __nonnull ((1, 2));
- extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
- __THROW __nonnull ((1));
- extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
- __attr, int *__restrict __inherit)
- __THROW __nonnull ((1, 2));
- extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
- int __inherit)
- __THROW __nonnull ((1));
- extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
- int *__restrict __scope)
- __THROW __nonnull ((1, 2));
- extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
- __THROW __nonnull ((1));
- extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
- __attr, void **__restrict __stackaddr)
- __THROW __nonnull ((1, 2)) __attribute_deprecated__;
- extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
- void *__stackaddr)
- __THROW __nonnull ((1)) __attribute_deprecated__;
- extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
- __attr, size_t *__restrict __stacksize)
- __THROW __nonnull ((1, 2));
- extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
- size_t __stacksize)
- __THROW __nonnull ((1));
- #ifdef __USE_XOPEN2K
- extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
- void **__restrict __stackaddr,
- size_t *__restrict __stacksize)
- __THROW __nonnull ((1, 2, 3));
- extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
- size_t __stacksize) __THROW __nonnull ((1));
- #endif
- #ifdef __USE_GNU
- extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
- size_t __cpusetsize,
- __const cpu_set_t *__cpuset)
- __THROW __nonnull ((1, 3));
- extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr,
- size_t __cpusetsize,
- cpu_set_t *__cpuset)
- __THROW __nonnull ((1, 3));
- extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr)
- __THROW __nonnull ((2));
- #endif
- extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
- __const struct sched_param *__param)
- __THROW __nonnull ((3));
- extern int pthread_getschedparam (pthread_t __target_thread,
- int *__restrict __policy,
- struct sched_param *__restrict __param)
- __THROW __nonnull ((2, 3));
- extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
- __THROW;
- #ifdef __USE_UNIX98
- extern int pthread_getconcurrency (void) __THROW;
- extern int pthread_setconcurrency (int __level) __THROW;
- #endif
- #ifdef __USE_GNU
- extern int pthread_yield (void) __THROW;
- extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize,
- __const cpu_set_t *__cpuset)
- __THROW __nonnull ((3));
- extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize,
- cpu_set_t *__cpuset)
- __THROW __nonnull ((3));
- #endif
- extern int pthread_once (pthread_once_t *__once_control,
- void (*__init_routine) (void)) __nonnull ((1, 2));
- extern int pthread_setcancelstate (int __state, int *__oldstate);
- extern int pthread_setcanceltype (int __type, int *__oldtype);
- extern int pthread_cancel (pthread_t __th);
- extern void pthread_testcancel (void);
- typedef struct
- {
- struct
- {
- __jmp_buf __cancel_jmp_buf;
- int __mask_was_saved;
- } __cancel_jmp_buf[1];
- void *__pad[4];
- } __pthread_unwind_buf_t __attribute__ ((__aligned__));
- #ifndef __cleanup_fct_attribute
- # define __cleanup_fct_attribute
- #endif
- struct __pthread_cleanup_frame
- {
- void (*__cancel_routine) (void *);
- void *__cancel_arg;
- int __do_it;
- int __cancel_type;
- };
- #if defined __GNUC__ && defined __EXCEPTIONS
- # ifdef __cplusplus
- class __pthread_cleanup_class
- {
- void (*__cancel_routine) (void *);
- void *__cancel_arg;
- int __do_it;
- int __cancel_type;
- public:
- __pthread_cleanup_class (void (*__fct) (void *), void *__arg)
- : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { }
- ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); }
- void __setdoit (int __newval) { __do_it = __newval; }
- void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED,
- &__cancel_type); }
- void __restore () const { pthread_setcanceltype (__cancel_type, 0); }
- };
- # define pthread_cleanup_push(routine, arg) \
- do { \
- __pthread_cleanup_class __clframe (routine, arg)
- # define pthread_cleanup_pop(execute) \
- __clframe.__setdoit (execute); \
- } while (0)
- # ifdef __USE_GNU
- # define pthread_cleanup_push_defer_np(routine, arg) \
- do { \
- __pthread_cleanup_class __clframe (routine, arg); \
- __clframe.__defer ()
- # define pthread_cleanup_pop_restore_np(execute) \
- __clframe.__restore (); \
- __clframe.__setdoit (execute); \
- } while (0)
- # endif
- # else
- __extern_inline void
- __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
- {
- if (__frame->__do_it)
- __frame->__cancel_routine (__frame->__cancel_arg);
- }
- # define pthread_cleanup_push(routine, arg) \
- do { \
- struct __pthread_cleanup_frame __clframe \
- __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \
- = { .__cancel_routine = (routine), .__cancel_arg = (arg), \
- .__do_it = 1 };
- # define pthread_cleanup_pop(execute) \
- __clframe.__do_it = (execute); \
- } while (0)
- # ifdef __USE_GNU
- # define pthread_cleanup_push_defer_np(routine, arg) \
- do { \
- struct __pthread_cleanup_frame __clframe \
- __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) \
- = { .__cancel_routine = (routine), .__cancel_arg = (arg), \
- .__do_it = 1 }; \
- (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED, \
- &__clframe.__cancel_type)
- # define pthread_cleanup_pop_restore_np(execute) \
- (void) pthread_setcanceltype (__clframe.__cancel_type, NULL); \
- __clframe.__do_it = (execute); \
- } while (0)
- # endif
- # endif
- #else
- # define pthread_cleanup_push(routine, arg) \
- do { \
- __pthread_unwind_buf_t __cancel_buf; \
- void (*__cancel_routine) (void *) = (routine); \
- void *__cancel_arg = (arg); \
- int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
- __cancel_buf.__cancel_jmp_buf, 0); \
- if (__builtin_expect (not_first_call, 0)) \
- { \
- __cancel_routine (__cancel_arg); \
- __pthread_unwind_next (&__cancel_buf); \
- \
- } \
- \
- __pthread_register_cancel (&__cancel_buf); \
- do {
- extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
- __cleanup_fct_attribute;
- # define pthread_cleanup_pop(execute) \
- do { } while (0);\
- } while (0); \
- __pthread_unregister_cancel (&__cancel_buf); \
- if (execute) \
- __cancel_routine (__cancel_arg); \
- } while (0)
- extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
- __cleanup_fct_attribute;
- # ifdef __USE_GNU
- # define pthread_cleanup_push_defer_np(routine, arg) \
- do { \
- __pthread_unwind_buf_t __cancel_buf; \
- void (*__cancel_routine) (void *) = (routine); \
- void *__cancel_arg = (arg); \
- int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
- __cancel_buf.__cancel_jmp_buf, 0); \
- if (__builtin_expect (not_first_call, 0)) \
- { \
- __cancel_routine (__cancel_arg); \
- __pthread_unwind_next (&__cancel_buf); \
- \
- } \
- \
- __pthread_register_cancel_defer (&__cancel_buf); \
- do {
- extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf)
- __cleanup_fct_attribute;
- # define pthread_cleanup_pop_restore_np(execute) \
- do { } while (0);\
- } while (0); \
- __pthread_unregister_cancel_restore (&__cancel_buf); \
- if (execute) \
- __cancel_routine (__cancel_arg); \
- } while (0)
- extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf)
- __cleanup_fct_attribute;
- # endif
- extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
- __cleanup_fct_attribute __attribute__ ((__noreturn__))
- # ifndef SHARED
- __attribute__ ((__weak__))
- # endif
- ;
- #endif
- struct __jmp_buf_tag;
- extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW;
- extern int pthread_mutex_init (pthread_mutex_t *__mutex,
- __const pthread_mutexattr_t *__mutexattr)
- __THROW __nonnull ((1));
- extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
- __THROW __nonnull ((1));
- extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
- __THROW __nonnull ((1));
- extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
- __THROW __nonnull ((1));
- #ifdef __USE_XOPEN2K
- extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
- __const struct timespec *__restrict
- __abstime) __THROW __nonnull ((1, 2));
- #endif
- extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
- __THROW __nonnull ((1));
- extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
- __restrict __mutex,
- int *__restrict __prioceiling)
- __THROW __nonnull ((1, 2));
- extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
- int __prioceiling,
- int *__restrict __old_ceiling)
- __THROW __nonnull ((1, 3));
- #ifdef __USE_XOPEN2K8
- extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
- __THROW __nonnull ((1));
- # ifdef __USE_GNU
- extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
- __THROW __nonnull ((1));
- # endif
- #endif
- extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
- __THROW __nonnull ((1));
- extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
- __THROW __nonnull ((1));
- extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
- __restrict __attr,
- int *__restrict __pshared)
- __THROW __nonnull ((1, 2));
- extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
- int __pshared)
- __THROW __nonnull ((1));
- #if defined __USE_UNIX98 || defined __USE_XOPEN2K8
- extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
- __attr, int *__restrict __kind)
- __THROW __nonnull ((1, 2));
- extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
- __THROW __nonnull ((1));
- #endif
- extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
- __restrict __attr,
- int *__restrict __protocol)
- __THROW __nonnull ((1, 2));
- extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
- int __protocol)
- __THROW __nonnull ((1));
- extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
- __restrict __attr,
- int *__restrict __prioceiling)
- __THROW __nonnull ((1, 2));
- extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
- int __prioceiling)
- __THROW __nonnull ((1));
- #ifdef __USE_XOPEN2K
- extern int pthread_mutexattr_getrobust (__const pthread_mutexattr_t *__attr,
- int *__robustness)
- __THROW __nonnull ((1, 2));
- # ifdef __USE_GNU
- extern int pthread_mutexattr_getrobust_np (__const pthread_mutexattr_t *__attr,
- int *__robustness)
- __THROW __nonnull ((1, 2));
- # endif
- extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
- int __robustness)
- __THROW __nonnull ((1));
- # ifdef __USE_GNU
- extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
- int __robustness)
- __THROW __nonnull ((1));
- # endif
- #endif
- #if defined __USE_UNIX98 || defined __USE_XOPEN2K
- extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
- __const pthread_rwlockattr_t *__restrict
- __attr) __THROW __nonnull ((1));
- extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
- extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
- extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
- # ifdef __USE_XOPEN2K
- extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
- __const struct timespec *__restrict
- __abstime) __THROW __nonnull ((1, 2));
- # endif
- extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
- extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
- # ifdef __USE_XOPEN2K
- extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
- __const struct timespec *__restrict
- __abstime) __THROW __nonnull ((1, 2));
- # endif
- extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
- extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
- __THROW __nonnull ((1));
- extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
- __THROW __nonnull ((1));
- extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
- __restrict __attr,
- int *__restrict __pshared)
- __THROW __nonnull ((1, 2));
- extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
- int __pshared)
- __THROW __nonnull ((1));
- extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
- __restrict __attr,
- int *__restrict __pref)
- __THROW __nonnull ((1, 2));
- extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
- int __pref) __THROW __nonnull ((1));
- #endif
- extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
- __const pthread_condattr_t *__restrict
- __cond_attr) __THROW __nonnull ((1));
- extern int pthread_cond_destroy (pthread_cond_t *__cond)
- __THROW __nonnull ((1));
- extern int pthread_cond_signal (pthread_cond_t *__cond)
- __THROW __nonnull ((1));
- extern int pthread_cond_broadcast (pthread_cond_t *__cond)
- __THROW __nonnull ((1));
- extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
- pthread_mutex_t *__restrict __mutex)
- __nonnull ((1, 2));
- extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
- pthread_mutex_t *__restrict __mutex,
- __const struct timespec *__restrict
- __abstime) __nonnull ((1, 2, 3));
- extern int pthread_condattr_init (pthread_condattr_t *__attr)
- __THROW __nonnull ((1));
- extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
- __THROW __nonnull ((1));
- extern int pthread_condattr_getpshared (__const pthread_condattr_t *
- __restrict __attr,
- int *__restrict __pshared)
- __THROW __nonnull ((1, 2));
- extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
- int __pshared) __THROW __nonnull ((1));
- #ifdef __USE_XOPEN2K
- extern int pthread_condattr_getclock (__const pthread_condattr_t *
- __restrict __attr,
- __clockid_t *__restrict __clock_id)
- __THROW __nonnull ((1, 2));
- extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
- __clockid_t __clock_id)
- __THROW __nonnull ((1));
- #endif
- #ifdef __USE_XOPEN2K
- extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
- __THROW __nonnull ((1));
- extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
- __THROW __nonnull ((1));
- extern int pthread_spin_lock (pthread_spinlock_t *__lock)
- __THROW __nonnull ((1));
- extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
- __THROW __nonnull ((1));
- extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
- __THROW __nonnull ((1));
- extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
- __const pthread_barrierattr_t *__restrict
- __attr, unsigned int __count)
- __THROW __nonnull ((1));
- extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
- __THROW __nonnull ((1));
- extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
- __THROW __nonnull ((1));
- extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
- __THROW __nonnull ((1));
- extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
- __THROW __nonnull ((1));
- extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
- __restrict __attr,
- int *__restrict __pshared)
- __THROW __nonnull ((1, 2));
- extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
- int __pshared)
- __THROW __nonnull ((1));
- #endif
- extern int pthread_key_create (pthread_key_t *__key,
- void (*__destr_function) (void *))
- __THROW __nonnull ((1));
- extern int pthread_key_delete (pthread_key_t __key) __THROW;
- extern void *pthread_getspecific (pthread_key_t __key) __THROW;
- extern int pthread_setspecific (pthread_key_t __key,
- __const void *__pointer) __THROW ;
- #ifdef __USE_XOPEN2K
- extern int pthread_getcpuclockid (pthread_t __thread_id,
- __clockid_t *__clock_id)
- __THROW __nonnull ((2));
- #endif
- extern int pthread_atfork (void (*__prepare) (void),
- void (*__parent) (void),
- void (*__child) (void)) __THROW;
- #ifdef __USE_EXTERN_INLINES
- __extern_inline int
- __NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2))
- {
- return __thread1 == __thread2;
- }
- #endif
- __END_DECLS
- #endif
|