summaryrefslogtreecommitdiff
path: root/sql/mdl.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-07-14 16:05:29 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2015-07-14 16:05:29 -0400
commitdced5146bdfc46e200ba35a86c3c55fb60972e33 (patch)
tree22e3dd18f4edec2a585341fee607765f96b2744f /sql/mdl.cc
parent75931feabe99595e9659a423e299c4229d3c02ba (diff)
downloadmariadb-git-dced5146bdfc46e200ba35a86c3c55fb60972e33.tar.gz
Merge branch '10.0-galera' into 10.1
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r--sql/mdl.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc
index 383cc042432..ec380aa7432 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -1063,6 +1063,13 @@ MDL_wait::timed_wait(MDL_context_owner *owner, struct timespec *abs_timeout,
while (!m_wait_status && !owner->is_killed() &&
wait_result != ETIMEDOUT && wait_result != ETIME)
{
+#ifdef WITH_WSREP
+ if (wsrep_thd_is_BF(owner->get_thd(), true))
+ {
+ wait_result= mysql_cond_wait(&m_COND_wait_status, &m_LOCK_wait_status);
+ }
+ else
+#endif
wait_result= mysql_cond_timedwait(&m_COND_wait_status, &m_LOCK_wait_status,
abs_timeout);
}
@@ -1148,12 +1155,15 @@ void MDL_lock::Ticket_list::add_ticket(MDL_ticket *ticket)
WSREP_DEBUG("MDL add_ticket inserted before: %lu %s",
thd_get_thread_id(waiting->get_ctx()->get_thd()),
wsrep_thd_query(waiting->get_ctx()->get_thd()));
+ /* Insert the ticket before the first non-BF waiting thd. */
m_list.insert_after(prev, ticket);
added= true;
}
prev= waiting;
}
- if (!added) m_list.push_back(ticket);
+
+ /* Otherwise, insert the ticket at the back of the waiting list. */
+ if (!added) m_list.push_back(ticket);
while ((granted= itg++))
{