The pthread.h header file contains function declarations and
mappings for threading interfaces and defines a number of constants used by those functions. The
header includes the sched.h header. When _UNIX03_THREADS is defined,
pthread.h also includes the time.h header. For
_OPEN_THREADS applications, pthread.h defines the timespec and
timespec64structures.
There is a lot of overlap in the namespaces identified
by the _OPEN_THREADS and _UNIX03_THREADS feature test macros. There
are, however, behavioral differences between functions of the same
name exposed by _OPEN_THREADS (POSIX.4a Draft 6) and by _UNIX03_THREADS
(Single UNIX Specification,
Version 3). See the individual function descriptions for specific
details.
_OPEN_THREADS 1
| pthread_attr_destroy() |
pthread_attr_getdetachstate() |
| pthread_attr_getstacksize() |
pthread_attr_init() |
| pthread_attr_setdetachstate() |
pthread_attr_setstacksize() |
| pthread_cancel() |
pthread_cleanup_pop() |
| pthread_cleanup_push() |
pthread_condattr_destroy() |
| pthread_condattr_init() |
pthread_cond_broadcast() |
| pthread_cond_destroy() |
pthread_cond_init() |
| pthread_cond_signal() |
pthread_cond_timedwait() |
| pthread_cond_timedwait64() |
pthread_cond_wait() |
| pthread_create() |
pthread_detach() |
| pthread_equal() |
pthread_exit() |
| pthread_getspecific() |
pthread_join() |
| pthread_key_create() |
pthread_kill() |
| pthread_mutexattr_destroy() |
pthread_mutexattr_getpshared() |
| pthread_mutexattr_gettype() |
pthread_mutexattr_init() |
| pthread_mutexattr_setpshared() |
pthread_mutexattr_settype() |
| pthread_mutex_destroy() |
pthread_mutex_init() |
| pthread_mutex_lock() |
pthread_mutex_trylock() |
| pthread_mutex_unlock() |
pthread_once() |
| pthread_rwlockattr_destroy() |
pthread_rwlockattr_getpshared() |
| pthread_rwlockattr_init() |
pthread_rwlockattr_setpshared() |
| pthread_rwlock_destroy() |
pthread_rwlock_init() |
| pthread_rwlock_rdlock() |
pthread_rwlock_tryrdlock() |
| pthread_rwlock_trywrlock() |
pthread_rwlock_unlock() |
| pthread_self() |
pthread_setintr() |
| pthread_setintrtype() |
pthread_setspecific() |
| pthread_testintr() |
pthread_tag_np() |
| pthread_yield() |
|
_OPEN_THREADS 2
| pthread_getconcurrency() |
pthread_key_delete() |
| pthread_setcancelstate() |
pthread_setcanceltype() |
| pthread_setconcurrency() |
pthread_testcancel() |
_OPEN_THREADS 3
| pthread_atfork() |
|
| pthread_attr_getguardsize() |
pthread_attr_setguardsize() |
| pthread_attr_getschedparam() |
pthread_attr_setschedparam() |
| pthread_attr_getstack() |
pthread_attr_setstack() |
| pthread_attr_getstackaddr() |
pthread_attr_setstackaddr() |
_UNIX03_THREADS
| pthread_atfork() |
pthread_getspecific() |
| pthread_attr_destroy() |
pthread_join() |
| pthread_attr_getdetachstate() |
pthread_key_create() |
| pthread_attr_getguardsize() |
pthread_key_delete() |
| pthread_attr_getschedparam() |
pthread_mutex_destroy() |
| pthread_attr_getstack() |
pthread_mutex_init() |
| pthread_attr_getstackaddr() |
pthread_mutex_lock() |
| pthread_attr_getstacksize() |
pthread_mutex_trylock() |
| pthread_attr_init() |
pthread_mutex_unlock() |
| pthread_attr_setdetachstate() |
pthread_mutexattr_destroy() |
| pthread_attr_setguardsize() |
pthread_mutexattr_getpshared() |
| pthread_attr_setschedparam() |
pthread_mutexattr_gettype() |
| pthread_attr_setstack() |
pthread_mutexattr_init() |
| pthread_attr_setstackaddr() |
pthread_mutexattr_setpshared() |
| pthread_attr_setstacksize() |
pthread_mutexattr_settype() |
| pthread_cancel() |
pthread_once() |
| pthread_cleanup_pop() |
pthread_rwlock_destroy() |
| pthread_cleanup_push() |
pthread_rwlock_init() |
| pthread_cond_broadcast() |
pthread_rwlock_rdlock() |
| pthread_cond_destroy() |
pthread_rwlock_tryrdlock() |
| pthread_cond_init() |
pthread_rwlock_trywrlock() |
| pthread_cond_signal() |
pthread_rwlock_unlock() |
| pthread_cond_timedwait() |
pthread_cond_timedwait64() |
| pthread_rwlock_wrlock() |
pthread_cond_wait() |
| pthread_rwlockattr_destroy() |
pthread_condattr_destroy() |
| pthread_rwlockattr_getpshared() |
pthread_condattr_getpshared() |
| pthread_rwlockattr_init() |
pthread_condattr_init() |
| pthread_rwlockattr_setpshared() |
pthread_condattr_setpshared() |
| pthread_self() |
pthread_create() |
| pthread_setcancelstate() |
pthread_detach() |
| pthread_setcanceltype() |
pthread_equal() |
| pthread_setconcurrency() |
pthread_exit() |
| pthread_setspecific() |
pthread_getconcurrency() |
| pthread_testcancel() |
|
| PTHREAD_CANCEL_ASYNCHRONOUS |
PTHREAD_MUTEX_DEFAULT |
| PTHREAD_CANCEL_DEFERRED |
PTHREAD_MUTEX_ERRORCHECK |
| PTHREAD_CANCEL_DISABLE |
PTHREAD_MUTEX_INITIALIZER |
| PTHREAD_CANCEL_ENABLE |
PTHREAD_MUTEX_NORMAL |
| PTHREAD_CANCELED |
PTHREAD_MUTEX_RECURSIVE |
| PTHREAD_COND_INITIALIZER |
PTHREAD_ONCE_INIT |
| PTHREAD_CREATE_DETACHED |
PTHREAD_PROCESS_PRIVATE |
| PTHREAD_CREATE_JOINABLE |
PTHREAD_PROCESS_SHARED |
| PTHREAD_EXPLICIT_SCHED |
PTHREAD_RWLOCK_INITIALIZER_NP |
| PTHREAD_INHERIT_SCHED |
|
_OPEN_SYS
| pthread_attr_getsynctype_np() |
pthread_attr_getweight_np() |
| pthread_attr_setsynctype_np() |
pthread_attr_setweight_np() |
| pthread_condattr_getkind_np() |
pthread_condattr_setkind_np() |
| pthread_join_d4_np() |
pthread_mutexattr_getkind_np() |
| pthread_mutexattr_setkind_np() |
pthread_security_np() |
| pthread_set_limit_np() |
pthread_tag_np() |
_OPEN_SYS_MUTEX_EXT
| pthread_condattr_getpshared() |
pthread_condattr_setpshared() |
The
pthread.h header defines the following constants:
| __COND_DEFAULT |
__COND_NODEBUG |
| __DETACHED |
__HEAVY_WEIGHT |
| __MEDIUM_WEIGHT |
__MUTEX_NODEBXG |
| __MUTEX_NONRECXRSIVE |
__MUTEX_RECXRSIVE |
| __UNDETACHED |
NO_PRIO_INHERIT |
| PRIO_INHERIT |
PTHREAD_DEFAULT_SCHED |
| PTHREAD_INHERIT_SCHED |
PTHREAD_INTR_ASYNCHRONOUS |
| PTHREAD_INTR_CONTROLLED |
PTHREAD_INTR_DISABLE |
| PTHREAD_INTR_ENABLE |
PTHREAD_ONCE_INIT |
| PTHREAD_PROCESS_PRIVATE |
PTHREAD_PROCESS_SHARED |
| PTHREAD_SCOPE_GLOBAL |
PTHREAD_SCOPE_LOCAL |
| SCHED_FIFO |
SCHED_OTHER |
| SCHED_RR |
PRIO_PROTECT |
Furthermore,
pthread.h defines these macros:
| PTHREAD_MUTEX_DEFAULT |
PTHREAD_MUTEX_ERRORCHECK |
| PTHREAD_MUTEX_NORMAL |
PTHREAD_MUTEX_INITIALIZER |
| PTHREAD_MUTEX_RECURSIVE |
PTHREAD_RWLOCK_INITIALIZER |
| __THDQ_LENGTH |
|
_OPEN_THREADS 2
| PTHREAD_CANCEL_ENABLE |
PTHREAD_CANCEL_DISABLE |
| PTHREAD_CANCEL_DEFERRED |
PTHREAD_CANCEL_ASYNCHRONOUS |