Skip to content

Commit a2de378

Browse files
montywivuvova
authored andcommitted
Add protection for reinitialization of mutex in parallel replaction
Added mutex_lock/mutex_unlock of mutex that is to be destroyed in wait_for_commit::reinit() in a similar fashion that we do in ~wait_for_commit
1 parent c5e25c8 commit a2de378

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sql/sql_class.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6516,7 +6516,13 @@ wait_for_commit::reinit()
65166516
65176517
So in this case, do a re-init of the mutex. In release builds, we want to
65186518
avoid the overhead of a re-init though.
6519+
6520+
To ensure that no one is locking the mutex, we take a lock of it first.
6521+
For full explanation, see wait_for_commit::~wait_for_commit()
65196522
*/
6523+
mysql_mutex_lock(&LOCK_wait_commit);
6524+
mysql_mutex_unlock(&LOCK_wait_commit);
6525+
65206526
mysql_mutex_destroy(&LOCK_wait_commit);
65216527
mysql_mutex_init(key_LOCK_wait_commit, &LOCK_wait_commit, MY_MUTEX_INIT_FAST);
65226528
#endif

0 commit comments

Comments
 (0)