pthread_mutexattr_destroy 2. Syntax 3. Param 4. Return Value 5. Remark 6. Example 7. Issue

Destroy a pthread_mutexattr_t object.

2. Syntax

1
#include <pthread.h>
1
int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);

3. Param

3.1 attr

A pointer that point to a object of pthread_mutexattr_t stuct; The object is a space that store mutex attributions.

The function shall destroy attr; the object becomes, in effect, uninitialized. An implementation may cause pthread_mutexattr_destroy() to set the object referenced by attr to an invalid value.

A destroyed attr can be reinitialized using pthread_mutexattr_init(); the results of otherwise referencing the object after it has been destroyed are undefined.

4. Return Value

Upon successful, return zero; otherwise, an error number shall be returned to indicate the error.

5. Remark

The behavior is undefined if the value specified by the attr argument to pthread_mutexattr_destroy() does not refer to an initialized mutex attributes object.

6. Example

7. Issue