diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-06-23 16:46:12 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-06-23 16:46:12 -0400 |
commit | 70714d3597ec9ffa742cc9e173d4ad32f294cc51 (patch) | |
tree | cff4572a50b569fbeefc2e5682916e917de7552d /sql/mdl.cc | |
parent | 46024098be1d7887134a3a3d8d289dd7711c56dc (diff) | |
parent | 71d1f35847a575239deff856590bf6f13afd74ed (diff) | |
download | mariadb-git-70714d3597ec9ffa742cc9e173d4ad32f294cc51.tar.gz |
Merge branch '5.5-galera' into 10.0-galera
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r-- | sql/mdl.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc index 4c962d3c570..f6390983ad9 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -1443,6 +1443,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); } @@ -1527,12 +1534,15 @@ void MDL_lock::Ticket_list::add_ticket(MDL_ticket *ticket) WSREP_DEBUG("MDL add_ticket inserted before: %lu %s", wsrep_thd_thread_id(waiting->get_ctx()->wsrep_get_thd()), wsrep_thd_query(waiting->get_ctx()->wsrep_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++)) { |