1PTHREAD_BARRIERATTR_GETPSHARPEODS(I3XP)Programmer'sPTMHaRnEuAaDl_BARRIERATTR_GETPSHARED(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       pthread_barrierattr_getpshared,  pthread_barrierattr_setpshared  —  get
14       and set the process-shared attribute of the barrier attributes object
15

SYNOPSIS

17       #include <pthread.h>
18
19       int pthread_barrierattr_getpshared(const pthread_barrierattr_t
20           *restrict attr, int *restrict pshared);
21       int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr,
22           int pshared);
23

DESCRIPTION

25       The pthread_barrierattr_getpshared() function shall obtain the value of
26       the process-shared attribute from the attributes object  referenced  by
27       attr.   The  pthread_barrierattr_setpshared()  function  shall  set the
28       process-shared attribute in an initialized attributes object referenced
29       by attr.
30
31       The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit
32       a barrier to be operated upon by any thread that has access to the mem‐
33       ory  where the barrier is allocated. If the process-shared attribute is
34       PTHREAD_PROCESS_PRIVATE, the barrier shall only  be  operated  upon  by
35       threads  created within the same process as the thread that initialized
36       the barrier; if threads of different processes attempt  to  operate  on
37       such  a  barrier,  the  behavior is undefined. The default value of the
38       attribute   shall   be    PTHREAD_PROCESS_PRIVATE.    Both    constants
39       PTHREAD_PROCESS_SHARED   and  PTHREAD_PROCESS_PRIVATE  are  defined  in
40       <pthread.h>.
41
42       Additional attributes, their default values, and the names of the asso‐
43       ciated  functions to get and set those attribute values are implementa‐
44       tion-defined.
45
46       The behavior is undefined if the value specified by the  attr  argument
47       to pthread_barrierattr_getpshared() or pthread_barrierattr_setpshared()
48       does not refer to an initialized barrier attributes object.
49

RETURN VALUE

51       If  successful,  the  pthread_barrierattr_getpshared()  function  shall
52       return zero and store the value of the process-shared attribute of attr
53       into the object referenced by  the  pshared  parameter.  Otherwise,  an
54       error number shall be returned to indicate the error.
55
56       If  successful,  the  pthread_barrierattr_setpshared()  function  shall
57       return zero; otherwise, an error number shall be returned  to  indicate
58       the error.
59

ERRORS

61       The pthread_barrierattr_setpshared() function may fail if:
62
63       EINVAL The  new value specified for the process-shared attribute is not
64              one   of   the   legal    values    PTHREAD_PROCESS_SHARED    or
65              PTHREAD_PROCESS_PRIVATE.
66
67       These functions shall not return an error code of [EINTR].
68
69       The following sections are informative.
70

EXAMPLES

72       None.
73

APPLICATION USAGE

75       The   pthread_barrierattr_getpshared()   and  pthread_barrierattr_setp‐
76       shared() functions are part of the Thread  Process-Shared  Synchroniza‐
77       tion option and need not be provided on all implementations.
78

RATIONALE

80       If an implementation detects that the value specified by the attr argu‐
81       ment to pthread_barrierattr_getpshared()  or  pthread_barrierattr_setp‐
82       shared() does not refer to an initialized barrier attributes object, it
83       is recommended that the function should fail  and  report  an  [EINVAL]
84       error.
85

FUTURE DIRECTIONS

87       None.
88

SEE ALSO

90       pthread_barrier_destroy(), pthread_barrierattr_destroy()
91
92       The Base Definitions volume of POSIX.1‐2008, <pthread.h>
93
95       Portions  of  this text are reprinted and reproduced in electronic form
96       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
97       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
98       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
99       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
100       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
101       event of any discrepancy between this version and the original IEEE and
102       The Open Group Standard, the original IEEE and The Open Group  Standard
103       is  the  referee document. The original Standard can be obtained online
104       at http://www.unix.org/online.html .
105
106       Any typographical or formatting errors that appear  in  this  page  are
107       most likely to have been introduced during the conversion of the source
108       files to man page format. To report such errors,  see  https://www.ker
109       nel.org/doc/man-pages/reporting_bugs.html .
110
111
112
113IEEE/The Open Group                  2013   PTHREAD_BARRIERATTR_GETPSHARED(3P)
Impressum