Multithreaded Programming Guide

Destroy a Mutex Attribute Object


pthread_mutexattr_destroy(3T) deallocates the storage space used to maintain the attribute object created by pthread_mutexattr_init().

int	pthread_mutexattr_destroy(pthread_mutexattr_t *mattr)
#include <pthread.h

pthread_mutexattr_t mattr;
int ret;

/* destroy an attribute */
ret = pthread_mutexattr_destroy(&mattr); 

Return Values

pthread_mutexattr_destroy() returns zero after completing successfully. Any other returned value indicates that an error occurred. If the following condition occurs, the function fails and returns the corresponding value.


The value specified by mattr is invalid.