snj doesn't like my accent, so use proper English month names.
[netbsd-mini2440.git] / lib / libpthread / pthread_barrier_wait.3
blob1f25321f80a05b6f5c0176badd1cad315cbd4821
1 .\" $NetBSD: pthread_barrier_wait.3,v 1.6 2005/06/17 18:23:52 wiz Exp $
2 .\"
3 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
14 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
15 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
17 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 .\" POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .Dd January 30, 2003
26 .Dt PTHREAD_BARRIER_WAIT 3
27 .Os
28 .Sh NAME
29 .Nm pthread_barrier_wait
30 .Nd wait for a barrier
31 .Sh LIBRARY
32 .Lb libpthread
33 .Sh SYNOPSIS
34 .In pthread.h
35 .Ft int
36 .Fn pthread_barrier_wait "pthread_barrier_t *barrier"
37 .Sh DESCRIPTION
38 The
39 .Fn pthread_barrier_wait
40 function causes the current thread to wait on the barrier specified.
41 Once as many threads as specified by the
42 .Fa count
43 parameter to the corresponding
44 .Fn pthread_barrier_init
45 call have called
46 .Fn pthread_barrier_wait ,
47 all threads will wake up, return from their respective
48 .Fn pthread_barrier_wait
49 calls and continue execution.
50 .Sh RETURN VALUES
51 If successful,
52 .Fn pthread_barrier_wait
53 will return zero for all waiting threads except for one.
54 One thread will receive status
55 .Dv PTHREAD_BARRIER_SERIAL_THREAD ,
56 which is intended to indicate that this thread may be used to update
57 shared data.
58 It is the responsibility of this thread to insure the visibility
59 and atomicity of any updates to shared data with respect to the
60 other threads participating in the barrier.
61 In the case of failure, an error value will be returned.
62 .Sh ERRORS
63 .Fn pthread_barrier_wait
64 may fail if:
65 .Bl -tag -width Er
66 .It Bq Er EINVAL
67 The value specified by
68 .Fa barrier
69 is invalid.
70 .El
71 .Sh SEE ALSO
72 .Xr pthread_barrier_destroy 3 ,
73 .Xr pthread_barrier_init 3 ,
74 .Xr pthread_barrierattr_destroy 3 ,
75 .Xr pthread_barrierattr_init 3
76 .Sh STANDARDS
77 .Fn pthread_barrier_wait
78 conforms to
79 .St -p1003.1-2001 .