Blame manual/threads.texi

Packit Service 82fcde
@node Threads
Packit Service 82fcde
@c @node Threads, Internal Probes, Debugging Support, Top
Packit Service 82fcde
@c %MENU% Functions, constants, and data types for working with threads
Packit Service 82fcde
@chapter Threads
Packit Service 82fcde
@cindex threads
Packit Service 82fcde
Packit Service 82fcde
This chapter describes functions used for managing threads.
Packit Service 82fcde
@Theglibc{} provides two threading implementations: ISO C threads and
Packit Service 82fcde
POSIX threads.
Packit Service 82fcde
Packit Service 82fcde
@menu
Packit Service 82fcde
* ISO C Threads::	Threads based on the ISO C specification.
Packit Service 82fcde
* POSIX Threads::	Threads based on the POSIX specification.
Packit Service 82fcde
@end menu
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
@node ISO C Threads
Packit Service 82fcde
@section ISO C Threads
Packit Service 82fcde
@cindex ISO C threads
Packit Service 82fcde
@cindex C threads
Packit Service 82fcde
@pindex threads.h
Packit Service 82fcde
Packit Service 82fcde
This section describes the @glibcadj{} ISO C threads implementation.
Packit Service 82fcde
To have a deeper understanding of this API, it is strongly recommended
Packit Service 82fcde
to read ISO/IEC 9899:2011, section 7.26, in which ISO C threads were
Packit Service 82fcde
originally specified.  All types and function prototypes are declared
Packit Service 82fcde
in the header file @file{threads.h}.
Packit Service 82fcde
Packit Service 82fcde
@menu
Packit Service 82fcde
* ISO C Threads Return Values:: Symbolic constants that represent a
Packit Service 82fcde
				function's return value.
Packit Service 82fcde
* ISO C Thread Management::	Support for basic threading.
Packit Service 82fcde
* Call Once::			Single-call functions and macros.
Packit Service 82fcde
* ISO C Mutexes::		A low-level mechanism for mutual exclusion.
Packit Service 82fcde
* ISO C Condition Variables::	High-level objects for thread synchronization.
Packit Service 82fcde
* ISO C Thread-local Storage::	Functions to support thread-local storage.
Packit Service 82fcde
@end menu
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
@node ISO C Threads Return Values
Packit Service 82fcde
@subsection Return Values
Packit Service 82fcde
Packit Service 82fcde
The ISO C thread specification provides the following enumeration
Packit Service 82fcde
constants for return values from functions in the API:
Packit Service 82fcde
Packit Service 82fcde
@vtable @code
Packit Service 82fcde
@item thrd_timedout
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
A specified time was reached without acquiring the requested resource,
Packit Service 82fcde
usually a mutex or condition variable.
Packit Service 82fcde
Packit Service 82fcde
@item thrd_success
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
The requested operation succeeded.
Packit Service 82fcde
Packit Service 82fcde
@item thrd_busy
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
The requested operation failed because a requested resource is already
Packit Service 82fcde
in use.
Packit Service 82fcde
Packit Service 82fcde
@item thrd_error
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
The requested operation failed.
Packit Service 82fcde
Packit Service 82fcde
@item thrd_nomem
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
The requested operation failed because it was unable to allocate
Packit Service 82fcde
enough memory.
Packit Service 82fcde
@end vtable
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
@node ISO C Thread Management
Packit Service 82fcde
@subsection Creation and Control
Packit Service 82fcde
@cindex thread creation
Packit Service 82fcde
@cindex thread control
Packit Service 82fcde
@cindex thread management
Packit Service 82fcde
Packit Service 82fcde
@Theglibc{} implements a set of functions that allow the user to easily
Packit Service 82fcde
create and use threads.  Additional functionality is provided to control
Packit Service 82fcde
the behavior of threads.
Packit Service 82fcde
Packit Service 82fcde
The following data types are defined for managing threads:
Packit Service 82fcde
Packit Service 82fcde
@deftp {Data Type} thrd_t
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
A unique object that identifies a thread.
Packit Service 82fcde
@end deftp
Packit Service 82fcde
Packit Service 82fcde
@deftp {Data Type} thrd_start_t
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
This data type is an @code{int (*) (void *)} typedef that is passed to
Packit Service 82fcde
@code{thrd_create} when creating a new thread.  It should point to the
Packit Service 82fcde
first function that thread will run.
Packit Service 82fcde
@end deftp
Packit Service 82fcde
Packit Service 82fcde
The following functions are used for working with threads:
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int thrd_create (thrd_t *@var{thr}, thrd_start_t @var{func}, void *@var{arg})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{thrd_create} creates a new thread that will execute the function
Packit Service 82fcde
@var{func}.  The object pointed to by @var{arg} will be used as the
Packit Service 82fcde
argument to @var{func}.  If successful, @var{thr} is set to the new
Packit Service 82fcde
thread identifier.
Packit Service 82fcde
Packit Service 82fcde
This function may return @code{thrd_success}, @code{thrd_nomem}, or
Packit Service 82fcde
@code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun thrd_t thrd_current (void)
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
This function returns the identifier of the calling thread.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int thrd_equal (thrd_t @var{lhs}, thrd_t @var{rhs})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{thrd_equal} checks whether @var{lhs} and @var{rhs} refer to the
Packit Service 82fcde
same thread.  If @var{lhs} and @var{rhs} are different threads, this
Packit Service 82fcde
function returns @math{0}; otherwise, the return value is non-zero.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int thrd_sleep (const struct timespec *@var{time_point}, struct timespec *@var{remaining})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{thrd_sleep} blocks the execution of the current thread for at
Packit Service 82fcde
least until the elapsed time pointed to by @var{time_point} has been
Packit Service 82fcde
reached.  This function does not take an absolute time, but a duration
Packit Service 82fcde
that the thread is required to be blocked.  @xref{Time Basics}, and
Packit Service 82fcde
@ref{Elapsed Time}.
Packit Service 82fcde
Packit Service 82fcde
The thread may wake early if a signal that is not ignored is received.
Packit Service 82fcde
In such a case, if @code{remaining} is not NULL, the remaining time
Packit Service 82fcde
duration is stored in the object pointed to by
Packit Service 82fcde
@var{remaining}.
Packit Service 82fcde
Packit Service 82fcde
@code{thrd_sleep} returns @math{0} if it blocked for at least the
Packit Service 82fcde
amount of time in @code{time_point}, @math{-1} if it was interrupted
Packit Service 82fcde
by a signal, or a negative number on failure.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun void thrd_yield (void)
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{thrd_yield} provides a hint to the implementation to reschedule
Packit Service 82fcde
the execution of the current thread, allowing other threads to run.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun {_Noreturn void} thrd_exit (int @var{res})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{thrd_exit} terminates execution of the calling thread and sets
Packit Service 82fcde
its result code to @var{res}.
Packit Service 82fcde
Packit Service 82fcde
If this function is called from a single-threaded process, the call is
Packit Service 82fcde
equivalent to calling @code{exit} with @code{EXIT_SUCCESS}
Packit Service 82fcde
(@pxref{Normal Termination}).  Also note that returning from a
Packit Service 82fcde
function that started a thread is equivalent to calling
Packit Service 82fcde
@code{thrd_exit}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int thrd_detach (thrd_t @var{thr})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{thrd_detach} detaches the thread identified by @code{thr} from
Packit Service 82fcde
the current control thread.  The resources held by the detached thread
Packit Service 82fcde
will be freed automatically once the thread exits.  The parent thread
Packit Service 82fcde
will never be notified by any @var{thr} signal.
Packit Service 82fcde
Packit Service 82fcde
Calling @code{thrd_detach} on a thread that was previously detached or
Packit Service 82fcde
joined by another thread results in undefined behavior.
Packit Service 82fcde
Packit Service 82fcde
This function returns either @code{thrd_success} or @code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int thrd_join (thrd_t @var{thr}, int *@var{res})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{thrd_join} blocks the current thread until the thread identified
Packit Service 82fcde
by @code{thr} finishes execution.  If @code{res} is not NULL, the
Packit Service 82fcde
result code of the thread is put into the location pointed to by
Packit Service 82fcde
@var{res}.  The termination of the thread @dfn{synchronizes-with} the
Packit Service 82fcde
completion of this function, meaning both threads have arrived at a
Packit Service 82fcde
common point in their execution.
Packit Service 82fcde
Packit Service 82fcde
Calling @code{thrd_join} on a thread that was previously detached or
Packit Service 82fcde
joined by another thread results in undefined behavior.
Packit Service 82fcde
Packit Service 82fcde
This function returns either @code{thrd_success} or @code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
@node Call Once
Packit Service 82fcde
@subsection Call Once
Packit Service 82fcde
@cindex call once
Packit Service 82fcde
@cindex single-call functions
Packit Service 82fcde
Packit Service 82fcde
In order to guarantee single access to a function, @theglibc{}
Packit Service 82fcde
implements a @dfn{call once function} to ensure a function is only
Packit Service 82fcde
called once in the presence of multiple, potentially calling threads.
Packit Service 82fcde
Packit Service 82fcde
@deftp {Data Type} once_flag
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
A complete object type capable of holding a flag used by @code{call_once}.
Packit Service 82fcde
@end deftp
Packit Service 82fcde
Packit Service 82fcde
@defvr Macro ONCE_FLAG_INIT
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
This value is used to initialize an object of type @code{once_flag}.
Packit Service 82fcde
@end defvr
Packit Service 82fcde
Packit Service 82fcde
@deftypefun void call_once (once_flag *@var{flag}, void (*@var{func}) (void))
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{call_once} calls function @var{func} exactly once, even if
Packit Service 82fcde
invoked from several threads.  The completion of the function
Packit Service 82fcde
@var{func} synchronizes-with all previous or subsequent calls to
Packit Service 82fcde
@code{call_once} with the same @code{flag} variable.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
@node ISO C Mutexes
Packit Service 82fcde
@subsection Mutexes
Packit Service 82fcde
@cindex mutex
Packit Service 82fcde
@cindex mutual exclusion
Packit Service 82fcde
Packit Service 82fcde
To have better control of resources and how threads access them,
Packit Service 82fcde
@theglibc{} implements a @dfn{mutex} object, which can help avoid race
Packit Service 82fcde
conditions and other concurrency issues.  The term ``mutex'' refers to
Packit Service 82fcde
mutual exclusion.
Packit Service 82fcde
Packit Service 82fcde
The fundamental data type for a mutex is the @code{mtx_t}:
Packit Service 82fcde
Packit Service 82fcde
@deftp {Data Type} mtx_t
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
The @code{mtx_t} data type uniquely identifies a mutex object.
Packit Service 82fcde
@end deftp
Packit Service 82fcde
Packit Service 82fcde
The ISO C standard defines several types of mutexes.  They are
Packit Service 82fcde
represented by the following symbolic constants:
Packit Service 82fcde
Packit Service 82fcde
@vtable @code
Packit Service 82fcde
@item mtx_plain
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
A mutex that does not support timeout, or test and return.
Packit Service 82fcde
Packit Service 82fcde
@item mtx_recursive
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
A mutex that supports recursive locking, which means that the owning
Packit Service 82fcde
thread can lock it more than once without causing deadlock.
Packit Service 82fcde
Packit Service 82fcde
@item mtx_timed
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
A mutex that supports timeout.
Packit Service 82fcde
@end vtable
Packit Service 82fcde
Packit Service 82fcde
The following functions are used for working with mutexes:
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int mtx_init (mtx_t *@var{mutex}, int @var{type})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{mtx_init} creates a new mutex object with type @var{type}.  The
Packit Service 82fcde
object pointed to by @var{mutex} is set to the identifier of the newly
Packit Service 82fcde
created mutex.
Packit Service 82fcde
Packit Service 82fcde
Not all combinations of mutex types are valid for the @code{type}
Packit Service 82fcde
argument.  Valid uses of mutex types for the @code{type} argument are:
Packit Service 82fcde
Packit Service 82fcde
@table @code
Packit Service 82fcde
@item mtx_plain
Packit Service 82fcde
A non-recursive mutex that does not support timeout.
Packit Service 82fcde
Packit Service 82fcde
@item mtx_timed
Packit Service 82fcde
A non-recursive mutex that does support timeout.
Packit Service 82fcde
Packit Service 82fcde
@item mtx_plain | mtx_recursive
Packit Service 82fcde
A recursive mutex that does not support timeout.
Packit Service 82fcde
Packit Service 82fcde
@item mtx_timed | mtx_recursive
Packit Service 82fcde
A recursive mutex that does support timeout.
Packit Service 82fcde
@end table
Packit Service 82fcde
Packit Service 82fcde
This function returns either @code{thrd_success} or @code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int mtx_lock (mtx_t *@var{mutex})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@asunsafe{@asulock{}}@acunsafe{@aculock{}}}
Packit Service 82fcde
@code{mtx_lock} blocks the current thread until the mutex pointed to
Packit Service 82fcde
by @var{mutex} is locked.  The behavior is undefined if the current
Packit Service 82fcde
thread has already locked the mutex and the mutex is not recursive.
Packit Service 82fcde
Packit Service 82fcde
Prior calls to @code{mtx_unlock} on the same mutex synchronize-with
Packit Service 82fcde
this operation (if this operation succeeds), and all lock/unlock
Packit Service 82fcde
operations on any given mutex form a single total order (similar to
Packit Service 82fcde
the modification order of an atomic).
Packit Service 82fcde
Packit Service 82fcde
This function returns either @code{thrd_success} or @code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int mtx_timedlock (mtx_t *restrict @var{mutex}, const struct timespec *restrict @var{time_point})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@asunsafe{@asulock{}}@acunsafe{@aculock{}}}
Packit Service 82fcde
@code{mtx_timedlock} blocks the current thread until the mutex pointed
Packit Service 82fcde
to by @var{mutex} is locked or until the calendar time pointed to by
Packit Service 82fcde
@var{time_point} has been reached.  Since this function takes an
Packit Service 82fcde
absolute time, if a duration is required, the calendar time must be
Packit Service 82fcde
calculated manually.  @xref{Time Basics}, and @ref{Calendar Time}.
Packit Service 82fcde
Packit Service 82fcde
If the current thread has already locked the mutex and the mutex is
Packit Service 82fcde
not recursive, or if the mutex does not support timeout, the behavior
Packit Service 82fcde
of this function is undefined.
Packit Service 82fcde
Packit Service 82fcde
Prior calls to @code{mtx_unlock} on the same mutex synchronize-with
Packit Service 82fcde
this operation (if this operation succeeds), and all lock/unlock
Packit Service 82fcde
operations on any given mutex form a single total order (similar to
Packit Service 82fcde
the modification order of an atomic).
Packit Service 82fcde
Packit Service 82fcde
This function returns either @code{thrd_success} or @code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int mtx_trylock (mtx_t *@var{mutex})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@asunsafe{@asulock{}}@acunsafe{@aculock{}}}
Packit Service 82fcde
@code{mtx_trylock} tries to lock the mutex pointed to by @var{mutex}
Packit Service 82fcde
without blocking.  It returns immediately if the mutex is already
Packit Service 82fcde
locked.
Packit Service 82fcde
Packit Service 82fcde
Prior calls to @code{mtx_unlock} on the same mutex synchronize-with
Packit Service 82fcde
this operation (if this operation succeeds), and all lock/unlock
Packit Service 82fcde
operations on any given mutex form a single total order (similar to
Packit Service 82fcde
the modification order of an atomic).
Packit Service 82fcde
Packit Service 82fcde
This function returns @code{thrd_success} if the lock was obtained,
Packit Service 82fcde
@code{thrd_busy} if the mutex is already locked, and @code{thrd_error}
Packit Service 82fcde
on failure.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int mtx_unlock (mtx_t *@var{mutex})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{mtx_unlock} unlocks the mutex pointed to by @var{mutex}.  The
Packit Service 82fcde
behavior is undefined if the mutex is not locked by the calling
Packit Service 82fcde
thread.
Packit Service 82fcde
Packit Service 82fcde
This function synchronizes-with subsequent @code{mtx_lock},
Packit Service 82fcde
@code{mtx_trylock}, and @code{mtx_timedlock} calls on the same mutex.
Packit Service 82fcde
All lock/unlock operations on any given mutex form a single total
Packit Service 82fcde
order (similar to the modification order of an atomic).
Packit Service 82fcde
Packit Service 82fcde
This function returns either @code{thrd_success} or @code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun void mtx_destroy (mtx_t *@var{mutex})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{mtx_destroy} destroys the mutex pointed to by @var{mutex}.  If
Packit Service 82fcde
there are any threads waiting on the mutex, the behavior is
Packit Service 82fcde
undefined.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
@node ISO C Condition Variables
Packit Service 82fcde
@subsection Condition Variables
Packit Service 82fcde
@cindex condvar
Packit Service 82fcde
@cindex condition variables
Packit Service 82fcde
Packit Service 82fcde
Mutexes are not the only synchronization mechanisms available.  For
Packit Service 82fcde
some more complex tasks, @theglibc{} also implements @dfn{condition
Packit Service 82fcde
variables}, which allow the programmer to think at a higher level when
Packit Service 82fcde
solving complex synchronization problems.  They are used to
Packit Service 82fcde
synchronize threads waiting on a certain condition to happen.
Packit Service 82fcde
Packit Service 82fcde
The fundamental data type for condition variables is the @code{cnd_t}:
Packit Service 82fcde
Packit Service 82fcde
@deftp {Data Type} cnd_t
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
The @code{cnd_t} uniquely identifies a condition variable object.
Packit Service 82fcde
@end deftp
Packit Service 82fcde
Packit Service 82fcde
The following functions are used for working with condition variables:
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int cnd_init (cnd_t *@var{cond})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{cnd_init} initializes a new condition variable, identified by
Packit Service 82fcde
@var{cond}.
Packit Service 82fcde
Packit Service 82fcde
This function may return @code{thrd_success}, @code{thrd_nomem}, or
Packit Service 82fcde
@code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int cnd_signal (cnd_t *@var{cond})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{cnd_signal} unblocks one thread that is currently waiting on the
Packit Service 82fcde
condition variable pointed to by @var{cond}.  If a thread is
Packit Service 82fcde
successfully unblocked, this function returns @code{thrd_success}.  If
Packit Service 82fcde
no threads are blocked, this function does nothing and returns
Packit Service 82fcde
@code{thrd_success}.  Otherwise, this function returns
Packit Service 82fcde
@code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int cnd_broadcast (cnd_t *@var{cond})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{cnd_broadcast} unblocks all the threads that are currently
Packit Service 82fcde
waiting on the condition variable pointed to by @var{cond}.  This
Packit Service 82fcde
function returns @code{thrd_success} on success.  If no threads are
Packit Service 82fcde
blocked, this function does nothing and returns
Packit Service 82fcde
@code{thrd_success}. Otherwise, this function returns
Packit Service 82fcde
@code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int cnd_wait (cnd_t *@var{cond}, mtx_t *@var{mutex})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@asunsafe{@asulock{}}@acunsafe{@aculock{}}}
Packit Service 82fcde
@code{cnd_wait} atomically unlocks the mutex pointed to by @var{mutex}
Packit Service 82fcde
and blocks on the condition variable pointed to by @var{cond} until
Packit Service 82fcde
the thread is signaled by @code{cnd_signal} or @code{cnd_broadcast}.
Packit Service 82fcde
The mutex is locked again before the function returns.
Packit Service 82fcde
Packit Service 82fcde
This function returns either @code{thrd_success} or @code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int cnd_timedwait (cnd_t *restrict @var{cond}, mtx_t *restrict @var{mutex}, const struct timespec *restrict @var{time_point})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@asunsafe{@asulock{}}@acunsafe{@aculock{}}}
Packit Service 82fcde
@code{cnd_timedwait} atomically unlocks the mutex pointed to by
Packit Service 82fcde
@var{mutex} and blocks on the condition variable pointed to by
Packit Service 82fcde
@var{cond} until the thread is signaled by @code{cnd_signal} or
Packit Service 82fcde
@code{cnd_broadcast}, or until the calendar time pointed to by
Packit Service 82fcde
@var{time_point} has been reached.  The mutex is locked again before
Packit Service 82fcde
the function returns.
Packit Service 82fcde
Packit Service 82fcde
As for @code{mtx_timedlock}, since this function takes an absolute
Packit Service 82fcde
time, if a duration is required, the calendar time must be calculated
Packit Service 82fcde
manually.  @xref{Time Basics}, and @ref{Calendar Time}.
Packit Service 82fcde
Packit Service 82fcde
This function may return @code{thrd_success}, @code{thrd_nomem}, or
Packit Service 82fcde
@code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun void cnd_destroy (cnd_t *@var{cond})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{cnd_destroy} destroys the condition variable pointed to by
Packit Service 82fcde
@var{cond}.  If there are threads waiting on @var{cond}, the behavior
Packit Service 82fcde
is undefined.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
@node ISO C Thread-local Storage
Packit Service 82fcde
@subsection Thread-local Storage
Packit Service 82fcde
@cindex thread-local storage
Packit Service 82fcde
Packit Service 82fcde
@Theglibc{} implements functions to provide @dfn{thread-local
Packit Service 82fcde
storage}, a mechanism by which variables can be defined to have unique
Packit Service 82fcde
per-thread storage, lifetimes that match the thread lifetime, and
Packit Service 82fcde
destructors that cleanup the unique per-thread storage.
Packit Service 82fcde
Packit Service 82fcde
Several data types and macros exist for working with thread-local
Packit Service 82fcde
storage:
Packit Service 82fcde
Packit Service 82fcde
@deftp {Data Type} tss_t
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
The @code{tss_t} data type identifies a thread-specific storage
Packit Service 82fcde
object.  Even if shared, every thread will have its own instance of
Packit Service 82fcde
the variable, with different values.
Packit Service 82fcde
@end deftp
Packit Service 82fcde
Packit Service 82fcde
@deftp {Data Type} tss_dtor_t
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
The @code{tss_dtor_t} is a function pointer of type @code{void (*)
Packit Service 82fcde
(void *)}, to be used as a thread-specific storage destructor.  The
Packit Service 82fcde
function will be called when the current thread calls @code{thrd_exit}
Packit Service 82fcde
(but never when calling @code{tss_delete} or @code{exit}).
Packit Service 82fcde
@end deftp
Packit Service 82fcde
Packit Service 82fcde
@defvr Macro thread_local
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@code{thread_local} is used to mark a variable with thread storage
Packit Service 82fcde
duration, which means it is created when the thread starts and cleaned
Packit Service 82fcde
up when the thread ends.
Packit Service 82fcde
Packit Service 82fcde
@emph{Note:} For C++, C++11 or later is required to use the
Packit Service 82fcde
@code{thread_local} keyword.
Packit Service 82fcde
@end defvr
Packit Service 82fcde
Packit Service 82fcde
@defvr Macro TSS_DTOR_ITERATIONS
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@code{TSS_DTOR_ITERATIONS} is an integer constant expression
Packit Service 82fcde
representing the maximum number of iterations over all thread-local
Packit Service 82fcde
destructors at the time of thread termination.  This value provides a
Packit Service 82fcde
bounded limit to the destruction of thread-local storage; e.g.,
Packit Service 82fcde
consider a destructor that creates more thread-local storage.
Packit Service 82fcde
@end defvr
Packit Service 82fcde
Packit Service 82fcde
The following functions are used to manage thread-local storage:
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int tss_create (tss_t *@var{tss_key}, tss_dtor_t @var{destructor})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{tss_create} creates a new thread-specific storage key and stores
Packit Service 82fcde
it in the object pointed to by @var{tss_key}.  Although the same key
Packit Service 82fcde
value may be used by different threads, the values bound to the key by
Packit Service 82fcde
@code{tss_set} are maintained on a per-thread basis and persist for
Packit Service 82fcde
the life of the calling thread.
Packit Service 82fcde
Packit Service 82fcde
If @code{destructor} is not NULL, a destructor function will be set,
Packit Service 82fcde
and called when the thread finishes its execution by calling
Packit Service 82fcde
@code{thrd_exit}.
Packit Service 82fcde
Packit Service 82fcde
This function returns @code{thrd_success} if @code{tss_key} is
Packit Service 82fcde
successfully set to a unique value for the thread; otherwise,
Packit Service 82fcde
@code{thrd_error} is returned and the value of @code{tss_key} is
Packit Service 82fcde
undefined.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int tss_set (tss_t @var{tss_key}, void *@var{val})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{tss_set} sets the value of the thread-specific storage
Packit Service 82fcde
identified by @var{tss_key} for the current thread to @var{val}.
Packit Service 82fcde
Different threads may set different values to the same key.
Packit Service 82fcde
Packit Service 82fcde
This function returns either @code{thrd_success} or @code{thrd_error}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun {void *} tss_get (tss_t @var{tss_key})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{tss_get} returns the value identified by @var{tss_key} held in
Packit Service 82fcde
thread-specific storage for the current thread.  Different threads may
Packit Service 82fcde
get different values identified by the same key.  On failure,
Packit Service 82fcde
@code{tss_get} returns zero.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun void tss_delete (tss_t @var{tss_key})
Packit Service 82fcde
@standards{C11, threads.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@code{tss_delete} destroys the thread-specific storage identified by
Packit Service 82fcde
@var{tss_key}.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
@node POSIX Threads
Packit Service 82fcde
@section POSIX Threads
Packit Service 82fcde
@cindex pthreads
Packit Service 82fcde
Packit Service 82fcde
This section describes the @glibcadj{} POSIX Threads implementation.
Packit Service 82fcde
Packit Service 82fcde
@menu
Packit Service 82fcde
* Thread-specific Data::          Support for creating and
Packit Service 82fcde
				  managing thread-specific data
Packit Service 82fcde
* Non-POSIX Extensions::          Additional functions to extend
Packit Service 82fcde
				  POSIX Thread functionality
Packit Service 82fcde
@end menu
Packit Service 82fcde
Packit Service 82fcde
@node Thread-specific Data
Packit Service 82fcde
@subsection Thread-specific Data
Packit Service 82fcde
Packit Service 82fcde
The @glibcadj{} implements functions to allow users to create and manage
Packit Service 82fcde
data specific to a thread.  Such data may be destroyed at thread exit,
Packit Service 82fcde
if a destructor is provided.  The following functions are defined:
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int pthread_key_create (pthread_key_t *@var{key}, void (*@var{destructor})(void*))
Packit Service 82fcde
@standards{POSIX, pthread.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@c pthread_key_create ok
Packit Service 82fcde
@c  KEY_UNUSED ok
Packit Service 82fcde
@c  KEY_USABLE ok
Packit Service 82fcde
Create a thread-specific data key for the calling thread, referenced by
Packit Service 82fcde
@var{key}.
Packit Service 82fcde
Packit Service 82fcde
Objects declared with the C++11 @code{thread_local} keyword are destroyed
Packit Service 82fcde
before thread-specific data, so they should not be used in thread-specific
Packit Service 82fcde
data destructors or even as members of the thread-specific data, since the
Packit Service 82fcde
latter is passed as an argument to the destructor function.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int pthread_key_delete (pthread_key_t @var{key})
Packit Service 82fcde
@standards{POSIX, pthread.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@c pthread_key_delete ok
Packit Service 82fcde
@c   This uses atomic compare and exchange to increment the seq number
Packit Service 82fcde
@c   after testing it's not a KEY_UNUSED seq number.
Packit Service 82fcde
@c  KEY_UNUSED dup ok
Packit Service 82fcde
Destroy the thread-specific data @var{key} in the calling thread.  The
Packit Service 82fcde
destructor for the thread-specific data is not called during destruction, nor
Packit Service 82fcde
is it called during thread exit.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun void *pthread_getspecific (pthread_key_t @var{key})
Packit Service 82fcde
@standards{POSIX, pthread.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
Packit Service 82fcde
@c pthread_getspecific ok
Packit Service 82fcde
Return the thread-specific data associated with @var{key} in the calling
Packit Service 82fcde
thread.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int pthread_setspecific (pthread_key_t @var{key}, const void *@var{value})
Packit Service 82fcde
@standards{POSIX, pthread.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@acucorrupt{} @acsmem{}}}
Packit Service 82fcde
@c pthread_setspecific @asucorrupt @ascuheap @acucorrupt @acsmem
Packit Service 82fcde
@c   a level2 block may be allocated by a signal handler after
Packit Service 82fcde
@c   another call already made a decision to allocate it, thus losing
Packit Service 82fcde
@c   the allocated value.  the seq number is updated before the
Packit Service 82fcde
@c   value, which might cause an earlier-generation value to seem
Packit Service 82fcde
@c   current if setspecific is cancelled or interrupted by a signal
Packit Service 82fcde
@c  KEY_UNUSED ok
Packit Service 82fcde
@c  calloc dup @ascuheap @acsmem
Packit Service 82fcde
Associate the thread-specific @var{value} with @var{key} in the calling thread.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
@node Non-POSIX Extensions
Packit Service 82fcde
@subsection Non-POSIX Extensions
Packit Service 82fcde
Packit Service 82fcde
In addition to implementing the POSIX API for threads, @theglibc{} provides
Packit Service 82fcde
additional functions and interfaces to provide functionality not specified in
Packit Service 82fcde
the standard.
Packit Service 82fcde
Packit Service 82fcde
@menu
Packit Service 82fcde
* Default Thread Attributes::             Setting default attributes for
Packit Service 82fcde
					  threads in a process.
Packit Service 82fcde
@end menu
Packit Service 82fcde
Packit Service 82fcde
@node Default Thread Attributes
Packit Service 82fcde
@subsubsection Setting Process-wide defaults for thread attributes
Packit Service 82fcde
Packit Service 82fcde
@Theglibc{} provides non-standard API functions to set and get the default
Packit Service 82fcde
attributes used in the creation of threads in a process.
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int pthread_getattr_default_np (pthread_attr_t *@var{attr})
Packit Service 82fcde
@standards{GNU, pthread.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@asunsafe{@asulock{}}@acunsafe{@aculock{}}}
Packit Service 82fcde
@c Takes lock around read from default_pthread_attr.
Packit Service 82fcde
Get the default attribute values and set @var{attr} to match.  This
Packit Service 82fcde
function returns @math{0} on success and a non-zero error code on
Packit Service 82fcde
failure.
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@deftypefun int pthread_setattr_default_np (pthread_attr_t *@var{attr})
Packit Service 82fcde
@standards{GNU, pthread.h}
Packit Service 82fcde
@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@aculock{} @acsmem{}}}
Packit Service 82fcde
@c pthread_setattr_default_np @ascuheap @asulock @aculock @acsmem
Packit Service 82fcde
@c  check_sched_policy_attr ok
Packit Service 82fcde
@c  check_sched_priority_attr ok
Packit Service 82fcde
@c   sched_get_priority_min dup ok
Packit Service 82fcde
@c   sched_get_priority_max dup ok
Packit Service 82fcde
@c  check_stacksize_attr ok
Packit Service 82fcde
@c  lll_lock @asulock @aculock
Packit Service 82fcde
@c  free dup @ascuheap @acsmem
Packit Service 82fcde
@c  realloc dup @ascuheap @acsmem
Packit Service 82fcde
@c  memcpy dup ok
Packit Service 82fcde
@c  lll_unlock @asulock @aculock
Packit Service 82fcde
Set the default attribute values to match the values in @var{attr}.  The
Packit Service 82fcde
function returns @math{0} on success and a non-zero error code on failure.
Packit Service 82fcde
The following error codes are defined for this function:
Packit Service 82fcde
Packit Service 82fcde
@table @code
Packit Service 82fcde
@item EINVAL
Packit Service 82fcde
At least one of the values in @var{attr} does not qualify as valid for the
Packit Service 82fcde
attributes or the stack address is set in the attribute.
Packit Service 82fcde
@item ENOMEM
Packit Service 82fcde
The system does not have sufficient memory.
Packit Service 82fcde
@end table
Packit Service 82fcde
@end deftypefun
Packit Service 82fcde
Packit Service 82fcde
@c FIXME these are undocumented:
Packit Service 82fcde
@c pthread_atfork
Packit Service 82fcde
@c pthread_attr_destroy
Packit Service 82fcde
@c pthread_attr_getaffinity_np
Packit Service 82fcde
@c pthread_attr_getdetachstate
Packit Service 82fcde
@c pthread_attr_getguardsize
Packit Service 82fcde
@c pthread_attr_getinheritsched
Packit Service 82fcde
@c pthread_attr_getschedparam
Packit Service 82fcde
@c pthread_attr_getschedpolicy
Packit Service 82fcde
@c pthread_attr_getscope
Packit Service 82fcde
@c pthread_attr_getstack
Packit Service 82fcde
@c pthread_attr_getstackaddr
Packit Service 82fcde
@c pthread_attr_getstacksize
Packit Service 82fcde
@c pthread_attr_init
Packit Service 82fcde
@c pthread_attr_setaffinity_np
Packit Service 82fcde
@c pthread_attr_setdetachstate
Packit Service 82fcde
@c pthread_attr_setguardsize
Packit Service 82fcde
@c pthread_attr_setinheritsched
Packit Service 82fcde
@c pthread_attr_setschedparam
Packit Service 82fcde
@c pthread_attr_setschedpolicy
Packit Service 82fcde
@c pthread_attr_setscope
Packit Service 82fcde
@c pthread_attr_setstack
Packit Service 82fcde
@c pthread_attr_setstackaddr
Packit Service 82fcde
@c pthread_attr_setstacksize
Packit Service 82fcde
@c pthread_barrierattr_destroy
Packit Service 82fcde
@c pthread_barrierattr_getpshared
Packit Service 82fcde
@c pthread_barrierattr_init
Packit Service 82fcde
@c pthread_barrierattr_setpshared
Packit Service 82fcde
@c pthread_barrier_destroy
Packit Service 82fcde
@c pthread_barrier_init
Packit Service 82fcde
@c pthread_barrier_wait
Packit Service 82fcde
@c pthread_cancel
Packit Service 82fcde
@c pthread_cleanup_push
Packit Service 82fcde
@c pthread_cleanup_pop
Packit Service 82fcde
@c pthread_condattr_destroy
Packit Service 82fcde
@c pthread_condattr_getclock
Packit Service 82fcde
@c pthread_condattr_getpshared
Packit Service 82fcde
@c pthread_condattr_init
Packit Service 82fcde
@c pthread_condattr_setclock
Packit Service 82fcde
@c pthread_condattr_setpshared
Packit Service 82fcde
@c pthread_cond_broadcast
Packit Service 82fcde
@c pthread_cond_destroy
Packit Service 82fcde
@c pthread_cond_init
Packit Service 82fcde
@c pthread_cond_signal
Packit Service 82fcde
@c pthread_cond_timedwait
Packit Service 82fcde
@c pthread_cond_wait
Packit Service 82fcde
@c pthread_create
Packit Service 82fcde
@c pthread_detach
Packit Service 82fcde
@c pthread_equal
Packit Service 82fcde
@c pthread_exit
Packit Service 82fcde
@c pthread_getaffinity_np
Packit Service 82fcde
@c pthread_getattr_np
Packit Service 82fcde
@c pthread_getconcurrency
Packit Service 82fcde
@c pthread_getcpuclockid
Packit Service 82fcde
@c pthread_getname_np
Packit Service 82fcde
@c pthread_getschedparam
Packit Service 82fcde
@c pthread_join
Packit Service 82fcde
@c pthread_kill
Packit Service 82fcde
@c pthread_kill_other_threads_np
Packit Service 82fcde
@c pthread_mutexattr_destroy
Packit Service 82fcde
@c pthread_mutexattr_getkind_np
Packit Service 82fcde
@c pthread_mutexattr_getprioceiling
Packit Service 82fcde
@c pthread_mutexattr_getprotocol
Packit Service 82fcde
@c pthread_mutexattr_getpshared
Packit Service 82fcde
@c pthread_mutexattr_getrobust
Packit Service 82fcde
@c pthread_mutexattr_getrobust_np
Packit Service 82fcde
@c pthread_mutexattr_gettype
Packit Service 82fcde
@c pthread_mutexattr_init
Packit Service 82fcde
@c pthread_mutexattr_setkind_np
Packit Service 82fcde
@c pthread_mutexattr_setprioceiling
Packit Service 82fcde
@c pthread_mutexattr_setprotocol
Packit Service 82fcde
@c pthread_mutexattr_setpshared
Packit Service 82fcde
@c pthread_mutexattr_setrobust
Packit Service 82fcde
@c pthread_mutexattr_setrobust_np
Packit Service 82fcde
@c pthread_mutexattr_settype
Packit Service 82fcde
@c pthread_mutex_consistent
Packit Service 82fcde
@c pthread_mutex_consistent_np
Packit Service 82fcde
@c pthread_mutex_destroy
Packit Service 82fcde
@c pthread_mutex_getprioceiling
Packit Service 82fcde
@c pthread_mutex_init
Packit Service 82fcde
@c pthread_mutex_lock
Packit Service 82fcde
@c pthread_mutex_setprioceiling
Packit Service 82fcde
@c pthread_mutex_timedlock
Packit Service 82fcde
@c pthread_mutex_trylock
Packit Service 82fcde
@c pthread_mutex_unlock
Packit Service 82fcde
@c pthread_once
Packit Service 82fcde
@c pthread_rwlockattr_destroy
Packit Service 82fcde
@c pthread_rwlockattr_getkind_np
Packit Service 82fcde
@c pthread_rwlockattr_getpshared
Packit Service 82fcde
@c pthread_rwlockattr_init
Packit Service 82fcde
@c pthread_rwlockattr_setkind_np
Packit Service 82fcde
@c pthread_rwlockattr_setpshared
Packit Service 82fcde
@c pthread_rwlock_destroy
Packit Service 82fcde
@c pthread_rwlock_init
Packit Service 82fcde
@c pthread_rwlock_rdlock
Packit Service 82fcde
@c pthread_rwlock_timedrdlock
Packit Service 82fcde
@c pthread_rwlock_timedwrlock
Packit Service 82fcde
@c pthread_rwlock_tryrdlock
Packit Service 82fcde
@c pthread_rwlock_trywrlock
Packit Service 82fcde
@c pthread_rwlock_unlock
Packit Service 82fcde
@c pthread_rwlock_wrlock
Packit Service 82fcde
@c pthread_self
Packit Service 82fcde
@c pthread_setaffinity_np
Packit Service 82fcde
@c pthread_setcancelstate
Packit Service 82fcde
@c pthread_setcanceltype
Packit Service 82fcde
@c pthread_setconcurrency
Packit Service 82fcde
@c pthread_setname_np
Packit Service 82fcde
@c pthread_setschedparam
Packit Service 82fcde
@c pthread_setschedprio
Packit Service 82fcde
@c pthread_sigmask
Packit Service 82fcde
@c pthread_sigqueue
Packit Service 82fcde
@c pthread_spin_destroy
Packit Service 82fcde
@c pthread_spin_init
Packit Service 82fcde
@c pthread_spin_lock
Packit Service 82fcde
@c pthread_spin_trylock
Packit Service 82fcde
@c pthread_spin_unlock
Packit Service 82fcde
@c pthread_testcancel
Packit Service 82fcde
@c pthread_timedjoin_np
Packit Service 82fcde
@c pthread_tryjoin_np
Packit Service 82fcde
@c pthread_yield