- Using SonarQube 8.5 build 37579 Developer Edition and latest sonar-scanner under linux environment.
Analyzing C++ project we get severan issues with the rule “This was not the most recently acquired lock. Possible lock order reversal” using pthread_mutex_lock/unlock. After manual revision, we can’t find why. This happens on any file using this family of mutexes.
Example of function with the issue:
pthread_mutex_lock(this->mutex); this->disconnect(); //No mutex management on this function pthread_mutex_unlock(this->mutex); ->This was not the most recently acquired lock. Possible lock order reversal. pthread_mutex_destroy(this->mutex); delete this->mutex; return; }