Use pthread_attr_destroy(3THR) to remove the storage allocated during initialization. The attribute object becomes invalid.
Prototype: int pthread_attr_destroy(pthread_attr_t *tattr);
#include <pthread.h> pthread_attr_t tattr; int ret; /* destroy an attribute */ ret = pthread_attr_destroy(&tattr);
pthread_attr_destroy() returns zero after completing successfully. Any other return value indicates that an error occurred. If the following condition occurs, the function fails and returns the corresponding value.