summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorprabakaran thirumalai <prabakaran.thirumalai@oracle.com>2013-07-30 09:44:11 +0530
committerprabakaran thirumalai <prabakaran.thirumalai@oracle.com>2013-07-30 09:44:11 +0530
commitd95e57a328bee96c9a7069aa6c9302771c341322 (patch)
tree6a47a11f1578933d54874fd12551fd481d57f837 /sql/sql_class.cc
parentf7940e407a373d018e70efe25f37b1a8b9318f03 (diff)
downloadmariadb-git-d95e57a328bee96c9a7069aa6c9302771c341322.tar.gz
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.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 80bd4eff457..d71da6403ae 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -605,6 +605,7 @@ THD::THD()
Open_tables_state(refresh_version), rli_fake(NULL), rli_slave(NULL),
lock_id(&main_lock_id),
user_time(0), in_sub_stmt(0),
+ fill_status_recursion_level(0),
sql_log_bin_toplevel(false),
binlog_table_maps(0), binlog_flags(0UL),
table_map_for_update(0),