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: >
A thread's resources are not immediately released at termination, unless
the thread was created with the detach state
attribute set to
PTHREAD_CREATE_DETACHED
, or if pthread_detach
is called for
its pthread_t
.
An undetached thread will remain terminated state until its identifier is passed to pthread_join
or pthread_detach
.
To sum it up, you have three options:
pthread_detach
), orpthread_join
).Hth.