Home | History | Annotate | Line # | Download | only in libpthread
 $NetBSD: threads.3,v 1.2 2019/04/27 10:57:11 wiz Exp $

Copyright (c) 2016 The NetBSD Foundation, Inc.
All rights reserved.

This code is derived from software contributed to The NetBSD Foundation
by Kamil Rytarowski.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

.Dd October 16, 2016 .Dt THREADS 3 .Os .Sh NAME .Nm threads .Nd C11 thread support library .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS n threads.h .Sh DESCRIPTION The C11 thread support library provides an implementation of a portable threading interface, built on top of the .Xr pthread 3 native interfaces. This library is composed of: l -dash t Initialization functions. t Condition variable functions. t Mutex functions. t Thread functions. t Thread-specifig storage functions. .El l -column "mtx_timedwait" t Sy "Function" Ta Sy "Summary" t Xr call_once 3 Ta calls function exactly once t Xr cnd_broadcast 3 Ta unblocks all threads blocked on a condition t Xr cnd_destroy 3 Ta releases all resources used by a condition t Xr cnd_init 3 Ta creates a condition variable t Xr cnd_signal 3 Ta unblocks one of threads blocked on a condition t Xr cnd_timedwait 3 Ta unlocks a mutex and blocks until a signal or timeout t Xr cnd_wait 3 Ta unlocks a mutex and blocks until a signal t Xr mtx_destroy 3 Ta releases resources used by a mutex t Xr mtx_init 3 Ta creates a mutex object with requested properties t Xr mtx_lock 3 Ta blocks on a mutex optionally with a recursive type t Xr mtx_timedwait 3 Ta tries to block until it locks a mutex or timeout t Xr mtx_trylock 3 Ta tries to lock a mutex t Xr mtx_unlock 3 Ta unlocks a mutex t Xr thrd_create 3 Ta creates a thread executing a function with a parameter t Xr thrd_current 3 Ta identifies the thread that called this function t Xr thrd_detach 3 Ta dispose of resources allocated to a thread on exit t Xr thrd_equal 3 Ta determines whether two threads refer the same thread t Xr thrd_exit 3 Ta terminates a calling thread and sets its result code t Xr thrd_join 3 Ta joins a thread with the current one and blocks t Xr thrd_sleep 3 Ta suspends a calling thread until a signal or timeout t Xr tss_create 3 Ta creates a thread-specific storage pointer with a destructor t Xr tss_delete 3 Ta releases resources used by a thread-specific storage t Xr tss_get 3 Ta gets a value of thread-specific storage from a key t Xr tss_set 3 Ta sets a value of thread-specific storage to a key .El .Sh SEE ALSO .Xr c11 1 , .Xr pthread 3 , .Xr c 7 .Sh STANDARDS The .Nm library interfaces conform to .St -isoC-2011 . .Sh HISTORY This interface first appeared in .Nx 9 . .Sh AUTHORS .An Kamil Rytarowski Aq Mt kamil (at] NetBSD.org