1PTHREAD_CONDATTR_DESTROY(P)POSIX Programmer's ManualPTHREAD_CONDATTR_DESTROY(P)
2
3
4

NAME

6       pthread_condattr_destroy,  pthread_condattr_init - destroy and initial‐
7       ize the condition variable attributes object
8

SYNOPSIS

10       #include <pthread.h>
11
12       int pthread_condattr_destroy(pthread_condattr_t *attr);
13       int pthread_condattr_init(pthread_condattr_t *attr);
14
15

DESCRIPTION

17       The pthread_condattr_destroy() function shall destroy a condition vari‐
18       able  attributes  object; the object becomes, in effect, uninitialized.
19       An implementation  may  cause  pthread_condattr_destroy()  to  set  the
20       object  referenced  by  attr  to  an  invalid  value.  A destroyed attr
21       attributes object can be reinitialized  using  pthread_condattr_init();
22       the  results  of  otherwise  referencing  the  object after it has been
23       destroyed are undefined.
24
25       The pthread_condattr_init() function shall initialize a condition vari‐
26       able  attributes  object  attr  with  the  default value for all of the
27       attributes defined by the implementation.
28
29       Results are undefined if pthread_condattr_init() is  called  specifying
30       an already initialized attr attributes object.
31
32       After  a condition variable attributes object has been used to initial‐
33       ize one  or  more  condition  variables,  any  function  affecting  the
34       attributes  object  (including destruction) shall not affect any previ‐
35       ously initialized condition variables.
36
37       This volume of IEEE Std 1003.1-2001 requires two attributes, the  clock
38       attribute and the process-shared attribute.
39
40       Additional attributes, their default values, and the names of the asso‐
41       ciated functions to get and set those attribute values are  implementa‐
42       tion-defined.
43

RETURN VALUE

45       If   successful,   the   pthread_condattr_destroy()   and  pthread_con‐
46       dattr_init() functions shall return zero; otherwise,  an  error  number
47       shall be returned to indicate the error.
48

ERRORS

50       The pthread_condattr_destroy() function may fail if:
51
52       EINVAL The value specified by attr is invalid.
53
54
55       The pthread_condattr_init() function shall fail if:
56
57       ENOMEM Insufficient  memory exists to initialize the condition variable
58              attributes object.
59
60
61       These functions shall not return an error code of [EINTR].
62
63       The following sections are informative.
64

EXAMPLES

66       None.
67

APPLICATION USAGE

69       None.
70

RATIONALE

72       See pthread_attr_init() and pthread_mutex_init() .
73
74       A process-shared attribute has been defined for condition variables for
75       the same reason it has been defined for mutexes.
76

FUTURE DIRECTIONS

78       None.
79

SEE ALSO

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