I\'m writing a program using the pthread library. When I run my program with the command valgrind --leak-check=full, I get the following errors description: >
You can make the thread in detached state to avoid the memory leak if the thread should not be joined (or just expires on it's own).
To explicitly create a thread as joinable or detached, the attr argument in the pthread_create() routine is used. The typical 4 step process is:
pthread_attr_t data type pthread_attr_init() pthread_attr_setdetachstate() pthread_attr_destroy()