#At file:///home/dlenev/src/bzr/mysql-next-4284-st-review/ based on revid:dlenev@stripped
3052 Dmitry Lenev 2010-01-18
A prerequisite patch for the fix for Bug#46272
"Bug #46272 MySQL 5.4.4, new MDL: unnecessary deadlock".
Instead of a single global mutex that protects the MDL
subsystem, use a mutex per one MDL lock.
Work on after review comments in progress.
modified:
sql/mdl.h
=== modified file 'sql/mdl.h'
--- a/sql/mdl.h 2010-01-16 09:27:03 +0000
+++ b/sql/mdl.h 2010-01-18 20:03:25 +0000
@@ -121,6 +121,9 @@ public:
return (m_length == rhs->m_length &&
memcmp(m_ptr, rhs->m_ptr, m_length) == 0);
}
+ /**
+ Compare two MDL keys lexicographically.
+ */
int cmp(const MDL_key *rhs) const
{
int res;
@@ -413,6 +416,9 @@ public:
inline THD *get_thd() const { return m_thd; }
+ /**
+ Wake up context which is waiting for a change of MDL_lock state.
+ */
void wake_up()
{
pthread_cond_signal(&m_cond);
@@ -424,6 +430,9 @@ public:
bool acquire_global_shared_lock();
void release_global_shared_lock();
+ /**
+ Check if this context owns global lock of particular type.
+ */
bool is_global_lock_owner(enum_mdl_type type_arg)
{
MDL_request mdl_request;
Attachment: [text/bzr-bundle] bzr/dlenev@mysql.com-20100118200325-h1b9c002cjrq21gp.bundle
| Thread |
|---|
| • bzr commit into mysql-5.6-next-mr branch (dlenev:3052) Bug#46272 | Dmitry Lenev | 18 Jan |