1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Bug#17083851 BACKPORT BUG#11765744 TO 5.1, 5.5 AND 5.6

Description:
Original fix Bug#11765744 changed mutex to read write lock
to avoid multiple recursive lock acquire operation on 
LOCK_status mutex.  
On Windows, locking read-write lock recursively is not safe. 
Slim read-write locks, which MySQL uses if they are supported by
Windows version, do not support recursion according to their 
documentation. For our own implementation of read-write lock, 
which is used in cases when Windows version doesn't support SRW,
recursive locking of read-write lock can easily lead to deadlock
if there are concurrent lock requests.
      
Fix:  
This patch reverts the previous fix for bug#11765744 that used
read-write locks. Instead problem of recursive locking for
LOCK_status mutex is solved by tracking recursion level using 
counter in THD object and acquiring lock only once when we enter 
fill_status() function first time.
This commit is contained in:
prabakaran thirumalai
2013-07-30 09:51:14 +05:30
3 changed files with 19 additions and 2 deletions

View File

@@ -781,6 +781,7 @@ THD::THD()
/* statement id */ 0),
rli_fake(0), rli_slave(NULL),
user_time(0), in_sub_stmt(0),
fill_status_recursion_level(0),
binlog_unsafe_warning_flags(0),
binlog_table_maps(0),
table_map_for_update(0),