1 .\" Copyright (c) 2004 Michael Telahun Makonnen
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .Dt PTHREAD_BARRIERATTR 3
31 .Nm pthread_barrierattr_destroy , pthread_barrierattr_getpshared ,
32 .Nm pthread_barrierattr_init , pthread_barrierattr_setpshared
33 .Nd "manipulate a barrier attribute object"
40 .Fn pthread_barrierattr_destroy "pthread_barrierattr_t *attr"
42 .Fn pthread_barrierattr_getpshared "const pthread_barrierattr_t *attr" "int *pshared"
44 .Fn pthread_barrierattr_init "pthread_barrierattr_t *attr"
46 .Fn pthread_barrierattr_setpshared "pthread_barrierattr_t *attr" "int pshared"
49 .Fn pthread_barrierattr_init
50 function will initialize
52 with default attributes.
54 .Fn pthread_barrierattr_destroy
57 and release any resources that may have been allocated on its behalf.
60 .Fn pthread_barrierattr_getpshared
61 function will put the value of the process-shared attribute from
63 into the memory area pointed to by
66 .Fn pthread_barrierattr_setpshared
67 function will set the process-shared attribute of
69 to the value specified in
73 may have one of the following values:
74 .Bl -tag -width ".Dv PTHREAD_PROCESS_PRIVATE"
75 .It Dv PTHREAD_PROCESS_PRIVATE
76 The barrier object it is attached to may only be accessed by
77 threads in the same process as the one that created the object.
78 .It Dv PTHREAD_PROCESS_SHARED
79 The barrier object it is attached to may be accessed by
80 threads in processes other than the one that created the object.
83 If successful, all these functions will return zero.
84 Otherwise, an error number will be returned to indicate the error.
86 None of these functions will return
90 .Fn pthread_barrierattr_destroy ,
91 .Fn pthread_barrierattr_getpshared
93 .Fn pthread_barrierattr_setpshared
94 functions may fail if:
97 The value specified by
103 .Fn pthread_barrierattr_init
104 function will fail if:
107 Insufficient memory to initialize the barrier attribute object
112 .Fn pthread_barrierattr_setpshared
113 function will fail if:
116 The value specified in
118 is not one of the allowed values.
121 .Xr pthread_barrier_destroy 3 ,
122 .Xr pthread_barrier_init 3 ,
123 .Xr pthread_barrier_wait 3
126 .Fn pthread_barrierattr_*
127 functions first appeared in
136 The implementation of
138 does not fully conform to
140 because the process-shared attribute is ignored in
144 if any value other than
145 .Dv PTHREAD_PROCESSES_PRIVATE
146 is specified in a call to
147 .Fn pthread_barrierattr_setpshared ,