Skip to content

Commit e26e9b2

Browse files
committed
Remove confusing trylock()
Summary: We don't need this trylock() as the original source of problem is fixed in https://reviews.facebook.net/D54741. Squash with 8194409 Per Database Read-Only Test Plan: mtr Reviewers: tianx Reviewed By: tianx Subscribers: webscalesql-eng Differential Revision: https://reviews.facebook.net/D55809
1 parent f8af202 commit e26e9b2

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

sql/sql_class.cc

+2-8
Original file line numberDiff line numberDiff line change
@@ -1703,16 +1703,10 @@ THD::~THD()
17031703
free_root(&transaction.mem_root,MYF(0));
17041704
mysql_mutex_destroy(&LOCK_thd_data);
17051705

1706-
/* The session may still holding the lock in an ongoing transaction, so we
1707-
* trylock and then unlock before destroying it. Note: we will not have
1708-
* another thread holding the lock to update the read_only hash table while
1709-
* this thread is being deleted. LOCK_thd_remove is locked before updating
1710-
* local read_only hash map, which prevents any thread being deleted. See
1711-
* sql_db.cc:update_thd_db_read_only() for details. */
1712-
mysql_mutex_trylock(&LOCK_thd_db_read_only_hash);
1706+
mysql_mutex_lock(&LOCK_thd_db_read_only_hash);
1707+
my_hash_free(&db_read_only_hash);
17131708
mysql_mutex_unlock(&LOCK_thd_db_read_only_hash);
17141709

1715-
my_hash_free(&db_read_only_hash);
17161710
mysql_mutex_destroy(&LOCK_thd_db_read_only_hash);
17171711

17181712
#ifndef DBUG_OFF

0 commit comments

Comments
 (0)