List:Commits« Previous MessageNext Message »
From:magnus.blaudd Date:June 22 2011 7:38am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4476)
View as plain text  
#At file:///home/msvensson/mysql/7.0/ based on revid:magnus.blaudd@stripped

 4476 magnus.blaudd@stripped	2011-06-22
      nbd
       - use mysql_ prefixed functions when working with mutexes and conds
        declared by MySQL Server
       - move the lock of LOCK_global_server_variables into the accessor
         function and fix mysql_ prefix

    modified:
      sql/ha_ndb_index_stat.cc
      sql/ha_ndbcluster.cc
=== modified file 'sql/ha_ndb_index_stat.cc'
--- a/sql/ha_ndb_index_stat.cc	2011-06-22 07:20:42 +0000
+++ b/sql/ha_ndb_index_stat.cc	2011-06-22 07:37:51 +0000
@@ -1585,20 +1585,20 @@ ndb_index_stat_thread_func(void *arg __a
   /*
     wait for mysql server to start
   */
-  pthread_mutex_lock(&LOCK_server_started);
+  mysql_mutex_lock(&LOCK_server_started);
   while (!mysqld_server_started)
   {
     set_timespec(abstime, 1);
-    pthread_cond_timedwait(&COND_server_started, &LOCK_server_started,
-	                       &abstime);
+    mysql_cond_timedwait(&COND_server_started, &LOCK_server_started,
+	                 &abstime);
     if (ndbcluster_terminating)
     {
-      pthread_mutex_unlock(&LOCK_server_started);
+      mysql_mutex_unlock(&LOCK_server_started);
       pthread_mutex_lock(&LOCK_ndb_index_stat_thread);
       goto ndb_index_stat_thread_end;
     }
   }
-  pthread_mutex_unlock(&LOCK_server_started);
+  mysql_mutex_unlock(&LOCK_server_started);
 
   /*
     Wait for cluster to start
@@ -1650,10 +1650,8 @@ ndb_index_stat_thread_func(void *arg __a
       goto ndb_index_stat_thread_end;
     pthread_mutex_unlock(&LOCK_ndb_index_stat_thread);
 
-    pthread_mutex_lock(&LOCK_global_system_variables);
     /* const bool enable_ok_new= THDVAR(NULL, index_stat_enable); */
     const bool enable_ok_new= ndb_index_stat_get_enable(NULL);
-    pthread_mutex_unlock(&LOCK_global_system_variables);
 
     Ndb_index_stat_proc pr;
     pr.ndb= thd_ndb->ndb;

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-06-22 07:12:01 +0000
+++ b/sql/ha_ndbcluster.cc	2011-06-22 07:37:51 +0000
@@ -265,7 +265,10 @@ static MYSQL_THDVAR_UINT(
 */
 bool ndb_index_stat_get_enable(THD *thd)
 {
-  return THDVAR(thd, index_stat_enable);
+  mysql_mutex_lock(&LOCK_global_system_variables);
+  const bool value = THDVAR(thd, index_stat_enable);
+  mysql_mutex_unlock(&LOCK_global_system_variables);
+  return value;
 }
 
 /*


Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110622073751-hvfb7u7uoohje1ng.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4476) magnus.blaudd22 Jun