Bug #60323 Unused mutex Lock_Acl
Submitted: 3 Mar 2011 20:40 Modified: 4 Mar 2011 12:02
Reporter: Linhai Song Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S5 (Performance)
Version:5.1.55 OS:Any
Assigned to: Marc ALFF CPU Architecture:Any
Tags: performance

[3 Mar 2011 20:40] Linhai Song
Description:
Description:
The following mutexes:

pthread_mutex_t  Lock_Acl

is initialized and destroyed, but never locked / unlocked in the server code.

How to repeat:
code review 

Suggested fix:
delete
[4 Mar 2011 4:26] Valeriy Kravchuk
I do not see this mutex in the current code of 5.0, 5.1 and 5.5:

macbook-pro:mysql-5.1-work openxs$ grep -rn Lock_Acl *
macbook-pro:mysql-5.1-work openxs$ cd ../mysql-5.0-work/
macbook-pro:mysql-5.0-work openxs$ grep -rn Lock_Acl *
macbook-pro:mysql-5.0-work openxs$ cd ../mysql-5.5-work/
macbook-pro:mysql-5.5-work openxs$ grep -rn Lock_Acl *
[4 Mar 2011 5:33] Linhai Song
The correct lock name is :

   LOCK_Acl

sorry for the mistake. 

./sql/mysql_priv.h:extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_lock_db,
./sql/mysqld.cc:pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count,
./sql/mysqld.cc:  (void) pthread_mutex_destroy(&LOCK_Acl);
./sql/mysqld.cc:  (void) pthread_mutex_init(&LOCK_Acl,MY_MUTEX_INIT_SLOW);
[4 Mar 2011 7:17] Valeriy Kravchuk
Indeed, I had to use -i in grep probably. Verified with current mysql-5.1 from bzr:

openxs@ubuntu:/home2/openxs/bzr2/mysql-5.1$ grep -rn LOCK_Acl *
client/mysql_priv.h:2025:extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_lock_db,
sql/mysql_priv.h:2025:extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_lock_db,
sql/mysqld.cc:671:pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count,
sql/mysqld.cc:1437:  (void) pthread_mutex_destroy(&LOCK_Acl);
sql/mysqld.cc:3610:  (void) pthread_mutex_init(&LOCK_Acl,MY_MUTEX_INIT_SLOW);
[4 Mar 2011 12:02] Marc ALFF
Duplicate of mysql bug#38967.
This is fixed in 5.5 already.