# pthread_condattr_destroy

## PROLOG



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


## NAME



           pthread_condattr_destroy, pthread_condattr_init — destroy and
           initialize the condition variable attributes object
    


## SYNOPSIS



           #include <pthread.h>
    
           int pthread_condattr_destroy(pthread_condattr_t *_attr_);
           int pthread_condattr_init(pthread_condattr_t *_attr_);
    


## DESCRIPTION



           The _pthread_condattr_destroy_() function shall destroy a condition
           variable attributes object; the object becomes, in effect,
           uninitialized. An implementation may cause
           _pthread_condattr_destroy_() to set the object referenced by _attr_ to
           an invalid value. A destroyed _attr_ attributes object can be
           reinitialized using _pthread_condattr_init_(); the results of
           otherwise referencing the object after it has been destroyed are
           undefined.
    
           The _pthread_condattr_init_() function shall initialize a condition
           variable attributes object _attr_ with the default value for all of
           the attributes defined by the implementation.
    
           Results are undefined if _pthread_condattr_init_() is called
           specifying an already initialized _attr_ attributes object.
    
           After a condition variable attributes object has been used to
           initialize one or more condition variables, any function affecting
           the attributes object (including destruction) shall not affect any
           previously initialized condition variables.
    
           This volume of POSIX.1‐2017 requires two attributes, the _clock_
           attribute and the _process-shared_ attribute.
    
           Additional attributes, their default values, and the names of the
           associated functions to get and set those attribute values are
           implementation-defined.
    
           The behavior is undefined if the value specified by the _attr_
           argument to _pthread_condattr_destroy_() does not refer to an
           initialized condition variable attributes object.
    


## RETURN VALUE



           If successful, the _pthread_condattr_destroy_() and
           _pthread_condattr_init_() functions shall return zero; otherwise, an
           error number shall be returned to indicate the error.
    


## ERRORS



           The _pthread_condattr_init_() function shall fail if:
    
           **ENOMEM** Insufficient memory exists to initialize the condition
                  variable attributes object.
    
           These functions shall not return an error code of **[EINTR]**.
    
           _The following sections are informative._
    


## EXAMPLES



           None.
    


## APPLICATION USAGE



           None.
    


## RATIONALE



           A _process-shared_ attribute has been defined for condition
           variables for the same reason it has been defined for mutexes.
    
           If an implementation detects that the value specified by the _attr_
           argument to _pthread_condattr_destroy_() does not refer to an
           initialized condition variable attributes object, it is
           recommended that the function should fail and report an **[EINVAL]**
           error.
    
           See also pthread_attr_destroy(3p) and pthread_mutex_destroy(3p).
    


## FUTURE DIRECTIONS



           None.
    


* * *