1pthread_barrierattr_getpshSatraendd(a3rCd)C Library Fputnhcrteiaodn_sbarrierattr_getpshared(3C)
2
3
4

NAME

6       pthread_barrierattr_getpshared,  pthread_barrierattr_setpshared  -  get
7       and set process-shared attribute of barrier attributes object
8

SYNOPSIS

10       cc -mt [ flag... ] file... [ library... ]
11       #include <pthread.h>
12
13       int pthread_barrierattr_getpshared(
14            const pthread_barrierattr_t *restrict attr,
15            int *restrict pshared);
16
17
18       int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr,
19            int pshared);
20
21

DESCRIPTION

23       The pthread_barrierattr_getpshared() function obtains the value of  the
24       process-shared attribute from the attributes object referenced by attr.
25       The pthread_barrierattr_setpshared() function sets  the  process-shared
26       attribute in an initialized attributes object referenced by attr.
27
28
29       The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit
30       a barrier to be operated upon by any thread that has access to the mem‐
31       ory  where the barrier is allocated. If the process-shared attribute is
32       PTHREAD_PROCESS_PRIVATE, the barrier will  only  be  operated  upon  by
33       threads  created within the same process as the thread that initialized
34       the barrier. If threads of different processes attempt  to  operate  on
35       such a barrier, the behavior is undefined.
36
37
38       The  default  value  of  the attribute is PTHREAD_PROCESS_PRIVATE. Both
39       constants  PTHREAD_PROCESS_SHARED   and   PTHREAD_PROCESS_PRIVATE   are
40       defined in <pthread.h>.
41
42
43       No  barrier attributes other than the process-shared attribute are pro‐
44       vided.
45

RETURN VALUES

47       Upon successful completion, the pthread_barrierattr_getpshared()  func‐
48       tion  returns 0 and stores the value of the process-shared attribute of
49       attr into the object referenced by the pshared  parameter.   Otherwise,
50       an error number is returned to indicate the error.
51
52
53       Upon  successful completion, the pthread_barrierattr_setpshared() func‐
54       tion returns 0. Otherwise, an error number is returned to indicate  the
55       error.
56

ERRORS

58       These functions may fail if:
59
60       EINVAL    The value specified by attr is invalid.
61
62
63
64       The pthread_barrierattr_setpshared() function may fail if:
65
66       EINVAL    The  new  value specified for the process-shared attribute is
67                 not  one  of  the  legal  values  PTHREAD_PROCESS_SHARED   or
68                 PTHREAD_PROCESS_PRIVATE.
69
70

ATTRIBUTES

72       See attributes(5) for descriptions of the following attributes:
73
74
75
76
77       ┌─────────────────────────────┬─────────────────────────────┐
78       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
79       ├─────────────────────────────┼─────────────────────────────┤
80       │Interface Stability          │Standard                     │
81       ├─────────────────────────────┼─────────────────────────────┤
82       │MT-Level                     │MT-Safe                      │
83       └─────────────────────────────┴─────────────────────────────┘
84

SEE ALSO

86       pthread_barrier_init(3C),              pthread_barrierattr_destroy(3C),
87       attributes(5), standards(5)
88
89
90
91SunOS 5.11                        30 Jan 2004pthread_barrierattr_getpshared(3C)
Impressum