xref: /netbsd-src/lib/libpthread/pthread_barrierattr.3 (revision d06479fa8dcf944f5964ed1b6a931ebb0e488100)
1.\" $NetBSD: pthread_barrierattr.3,v 1.13 2017/10/22 18:37:01 abhinav 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 June 12, 2016
26.Dt PTHREAD_BARRIERATTR 3
27.Os
28.Sh NAME
29.Nm pthread_barrierattr_init ,
30.Nm pthread_barrierattr_destroy ,
31.Nm pthread_barrierattr_getpshared ,
32.Nm pthread_barrierattr_setpshared
33.Nd barrier attribute operations
34.Sh LIBRARY
35.Lb libpthread
36.Sh SYNOPSIS
37.In pthread.h
38.Ft int
39.Fn pthread_barrierattr_init "pthread_barrierattr_t *attr"
40.Ft int
41.Fn pthread_barrierattr_destroy "pthread_barrierattr_t *attr"
42.Ft int
43.Fn pthread_barrierattr_getpshared "const pthread_barrierattr_t * __restrict attr" "int * __restrict pshared"
44.Ft int
45.Fn pthread_barrierattr_setpshared "pthread_barrierattr_t * attr" "int pshared"
46.Sh DESCRIPTION
47Barrier attributes are used to specify parameters to be used with
48.Xr pthread_barrier_init 3 .
49One attribute object can be used in multiple calls to
50.Fn pthread_barrier_init ,
51with or without modifications between calls.
52.Pp
53The
54.Fn pthread_barrierattr_init
55function initializes
56.Fa attr
57with the default barrier attributes.
58.Pp
59The
60.Fn pthread_barrierattr_destroy
61function destroys
62.Fa attr .
63.Pp
64The
65.Fn pthread_barrierattr_getpshared
66function shall obtain the value of the process-shared attribute
67from the attributes object referenced by
68.Fa attr .
69.Pp
70The
71.Fn pthread_barrierattr_setpshared
72function shall set the process-shared attribute in an initialized
73attributes object referenced by
74.Fa attr .
75.Sh RETURN VALUES
76If successful, these functions return 0.
77Otherwise, an error number is returned to indicate the error.
78.Sh ERRORS
79No error codes are defined for
80.Fn pthread_barrierattr_init .
81.Pp
82The
83.Fn pthread_barrierattr_destroy
84function may fail if:
85.Bl -tag -width Er
86.It Bq Er EINVAL
87The value specified by
88.Fa attr
89is invalid.
90.El
91.Pp
92The
93.Fn pthread_barrierattr_getpshared
94and
95.Fn pthread_barrierattr_setpshared
96functions may fail if:
97.Bl -tag -width Er
98.It Bq Er EINVAL
99The value specified by
100.Fa attr
101is invalid.
102.El
103.Sh SEE ALSO
104.Xr pthread_barrier_init 3
105.Sh STANDARDS
106These functions conform to
107.St -p1003.1-2001 .
108.Sh BUGS
109The
110.Fn pthread_barrierattr_getpshared
111and
112.Fn pthread_barrierattr_setpshared
113functions are hidden by default since only thread shared attributes
114are supported.
115