1PTHREAD_BARRIERATTR_GETPSHARPEODS(IPX)Programmer'sPMTaHnRuEaAlD_BARRIERATTR_GETPSHARED(P)
2
3
4

NAME

6       pthread_barrierattr_getpshared,  pthread_barrierattr_setpshared  -  get
7       and set the process-shared attribute of the barrier  attributes  object
8       (ADVANCED REALTIME THREADS)
9

SYNOPSIS

11       #include <pthread.h>
12
13
14
15       int pthread_barrierattr_getpshared(const pthread_barrierattr_t *
16              restrict attr, int *restrict pshared);
17       int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr,
18              int pshared);
19
20

DESCRIPTION

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

RETURN VALUE

44       If  successful,  the  pthread_barrierattr_getpshared()  function  shall
45       return zero and store the value of the process-shared attribute of attr
46       into the object referenced by  the  pshared  parameter.  Otherwise,  an
47       error number shall be returned to indicate the error.
48
49       If  successful,  the  pthread_barrierattr_setpshared()  function  shall
50       return zero; otherwise, an error number shall be returned  to  indicate
51       the error.
52

ERRORS

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

EXAMPLES

71       None.
72

APPLICATION USAGE

74       The   pthread_barrierattr_getpshared()   and  pthread_barrierattr_setp‐
75       shared() functions are part of the Barriers option and need not be pro‐
76       vided on all implementations.
77

RATIONALE

79       None.
80

FUTURE DIRECTIONS

82       None.
83

SEE ALSO

85       pthread_barrier_destroy()     ,     pthread_barrierattr_destroy()     ,
86       pthread_barrierattr_init()   ,   the   Base   Definitions   volume   of
87       IEEE Std 1003.1-2001, <pthread.h>
88
90       Portions  of  this text are reprinted and reproduced in electronic form
91       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
92       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
93       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
94       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
95       event of any discrepancy between this version and the original IEEE and
96       The  Open Group Standard, the original IEEE and The Open Group Standard
97       is the referee document. The original Standard can be  obtained  online
98       at http://www.opengroup.org/unix/online.html .
99
100
101
102IEEE/The Open Group                  2003    PTHREAD_BARRIERATTR_GETPSHARED(P)
Impressum