Hi developers, in the below codes, the lock mutexFD could be not released before program's exit exit(1); when slot == MAXTHRDS . I think there is no harm to write pthread_mutex_unlock (&mutexFD); before the exit(1); for better resource management and code symmetry. Thanks!
thanks for your comments. I will review them. In all the years of running pwalk this exception has never been hit. When the process terminates would that not release the threads and locks?
Hi developers, in the below codes, the lock
mutexFD
could be not released before program's exit exit(1); whenslot == MAXTHRDS
. I think there is no harm to writepthread_mutex_unlock (&mutexFD);
before the exit(1); for better resource management and code symmetry. Thanks!https://github.com/fizwit/filesystem-reporting-tools/blob/1df438e9345487b9c51d1eea3c93611e9198f173/pwalk.c#L214-L229