class AAA
{
...
~AAA()
{
pthread_mutex_lock( &m_mutex );
pthread_mutex_destroy( &m_mutex );
}
}
Question> I saw this code somewhere in a project. Is it good practice to do so? Or it is undefined behavior to lock a mutex before destroying it?