diff options
Diffstat (limited to 'sql/mdl.h')
-rw-r--r-- | sql/mdl.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/mdl.h b/sql/mdl.h index 59bc1f64762..42461f6ac2f 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -624,10 +624,11 @@ private: /** Read-write lock protecting m_waiting_for member. - TODO/FIXME: Replace with RW-lock which will prefer readers - on all platforms and not only on Linux. + @note The fact that this read-write lock prefers readers is + important as deadlock detector won't work correctly + otherwise. @sa Comment for MDL_lock::m_rwlock. */ - rw_lock_t m_waiting_for_lock; + rw_pr_lock_t m_waiting_for_lock; MDL_ticket *m_waiting_for; uint m_deadlock_weight; /** @@ -651,9 +652,9 @@ private: void will_wait_for(MDL_ticket *pending_ticket) { - rw_wrlock(&m_waiting_for_lock); + rw_pr_wrlock(&m_waiting_for_lock); m_waiting_for= pending_ticket; - rw_unlock(&m_waiting_for_lock); + rw_pr_unlock(&m_waiting_for_lock); } void set_deadlock_weight(uint weight) @@ -669,9 +670,9 @@ private: void stop_waiting() { - rw_wrlock(&m_waiting_for_lock); + rw_pr_wrlock(&m_waiting_for_lock); m_waiting_for= NULL; - rw_unlock(&m_waiting_for_lock); + rw_pr_unlock(&m_waiting_for_lock); } void wait_reset() |