1pthread_condattr_init(3C)Standard C Library Functionspthread_condattr_init(3C)
2
3
4

NAME

6       pthread_condattr_init, pthread_condattr_destroy - initialize or destroy
7       condition variable attributes object
8

SYNOPSIS

10       cc -mt [ flag... ] file... -lpthread [ library... ]
11       #include <pthread.h>
12
13       int pthread_condattr_init(pthread_condattr_t *attr);
14
15
16       int pthread_condattr_destroy(pthread_condattr_t *attr);
17
18

DESCRIPTION

20       The pthread_condattr_init() function initializes a  condition  variable
21       attributes object attr with the default value for all of the attributes
22       defined by the implementation.
23
24
25       At present, the only attribute available  is  the  scope  of  condition
26       variables.  The default scope of the attribute is  PTHREAD_PROCESS_PRI‐
27       VATE.
28
29
30       Attempts  to  initialize  previously  initialized  condition   variable
31       attributes object will leave the storage allocated by the previous ini‐
32       tialization unallocated.
33
34
35       After a condition variable attributes object has been used to  initial‐
36       ize  one  or  more  condition  variables,  any  function  affecting the
37       attributes object (including destruction) does not  affect  any  previ‐
38       ously initialized condition variables.
39
40
41       The  pthread_condattr_destroy()  function destroys a condition variable
42       attributes object; the object becomes,  in  effect,  uninitialized.  An
43       implementation  may  cause pthread_condattr_destroy() to set the object
44       referenced by attr to an invalid value. A destroyed condition  variable
45       attributes  object can be re-initialized using pthread_condattr_init();
46       the results of otherwise referencing  the  object  after  it  has  been
47       destroyed are undefined.
48
49
50       Additional attributes, their default values, and the names of the asso‐
51       ciated functions to get and set those attribute values are  implementa‐
52       tion-dependent.
53

RETURN VALUES

55       If    successful,    the   pthread_condattr_init()   and   pthread_con‐
56       dattr_destroy() functions return  0.  Otherwise,  an  error  number  is
57       returned to indicate the error.
58

ERRORS

60       The  pthread_condattr_init() function will fail if:
61
62       ENOMEM    Insufficient  memory exists to initialize the condition vari‐
63                 able attributes object.
64
65
66
67       The pthread_condattr_destroy() function may fail if:
68
69       EINVAL    The value specified by attr is invalid.
70
71

ATTRIBUTES

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

SEE ALSO

87       pthread_condattr_getpshared(3C),       pthread_condattr_setpshared(3C),
88       pthread_cond_init(3C),    pthread_create(3C),   pthread_mutex_init(3C),
89       attributes(5), standards(5)
90
91
92
93SunOS 5.11                        23 Mar 2005        pthread_condattr_init(3C)
Impressum