Below is the list of changes that have just been committed into a local
5.1 repository of marty. When marty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-12-21 16:30:07+01:00, mskold@stripped +1 -0
Merge mskold@stripped:/home/bk/mysql-5.1-ndb
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb
MERGE: 1.2371.1.3
sql/ha_ndbcluster.cc@stripped, 2006-12-21 16:30:01+01:00, mskold@stripped +0 -0
Auto merged
MERGE: 1.378.1.1
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: mskold
# Host: linux.site
# Root: /windows/Linux_space/MySQL/mysql-5.1-new-ndb/RESYNC
--- 1.381/sql/ha_ndbcluster.cc 2006-12-21 16:30:18 +01:00
+++ 1.382/sql/ha_ndbcluster.cc 2006-12-21 16:30:18 +01:00
@@ -134,7 +134,6 @@ static uint ndbcluster_alter_table_flags
}
static int ndbcluster_inited= 0;
-int ndbcluster_util_inited= 0;
static Ndb* g_ndb= NULL;
Ndb_cluster_connection* g_ndb_cluster_connection= NULL;
@@ -158,6 +157,7 @@ static int ndb_get_table_statistics(ha_n
// Util thread variables
pthread_t ndb_util_thread;
+int ndb_util_thread_running= 0;
pthread_mutex_t LOCK_ndb_util_thread;
pthread_cond_t COND_ndb_util_thread;
pthread_handler_t ndb_util_thread_func(void *arg);
@@ -6730,6 +6730,12 @@ static int ndbcluster_init(void *p)
goto ndbcluster_init_error;
}
+ /* Wait for the util thread to start */
+ pthread_mutex_lock(&LOCK_ndb_util_thread);
+ while (!ndb_util_thread_running)
+ pthread_cond_wait(&COND_ndb_util_thread, &LOCK_ndb_util_thread);
+ pthread_mutex_unlock(&LOCK_ndb_util_thread);
+
ndbcluster_inited= 1;
DBUG_RETURN(FALSE);
@@ -6752,6 +6758,27 @@ static int ndbcluster_end(handlerton *ht
if (!ndbcluster_inited)
DBUG_RETURN(0);
+ ndbcluster_inited= 0;
+
+ /* wait for util thread to finish */
+ pthread_mutex_lock(&LOCK_ndb_util_thread);
+ if (ndb_util_thread_running > 0)
+ {
+ pthread_cond_signal(&COND_ndb_util_thread);
+ pthread_mutex_unlock(&LOCK_ndb_util_thread);
+
+ pthread_mutex_lock(&LOCK_ndb_util_thread);
+ while (ndb_util_thread_running > 0)
+ {
+ struct timespec abstime;
+ set_timespec(abstime, 1);
+ pthread_cond_timedwait(&COND_ndb_util_thread,
+ &LOCK_ndb_util_thread,
+ &abstime);
+ }
+ }
+ pthread_mutex_unlock(&LOCK_ndb_util_thread);
+
#ifdef HAVE_NDB_BINLOG
{
@@ -6798,7 +6825,6 @@ static int ndbcluster_end(handlerton *ht
pthread_mutex_destroy(&ndbcluster_mutex);
pthread_mutex_destroy(&LOCK_ndb_util_thread);
pthread_cond_destroy(&COND_ndb_util_thread);
- ndbcluster_inited= 0;
DBUG_RETURN(0);
}
@@ -8344,6 +8370,7 @@ pthread_handler_t ndb_util_thread_func(v
{
thd->cleanup();
delete thd;
+ ndb_util_thread_running= 0;
DBUG_RETURN(NULL);
}
thd->init_for_queries();
@@ -8356,6 +8383,9 @@ pthread_handler_t ndb_util_thread_func(v
thd->main_security_ctx.priv_user = 0;
thd->current_stmt_binlog_row_based= TRUE; // If in mixed mode
+ ndb_util_thread_running= 1;
+ pthread_cond_signal(&COND_ndb_util_thread);
+
/*
wait for mysql server to start
*/
@@ -8364,8 +8394,6 @@ pthread_handler_t ndb_util_thread_func(v
pthread_cond_wait(&COND_server_started, &LOCK_server_started);
pthread_mutex_unlock(&LOCK_server_started);
- ndbcluster_util_inited= 1;
-
/*
Wait for cluster to start
*/
@@ -8547,6 +8575,9 @@ ndb_util_thread_end:
net_end(&thd->net);
thd->cleanup();
delete thd;
+ pthread_mutex_lock(&LOCK_ndb_util_thread);
+ ndb_util_thread_running= 0;
+ pthread_mutex_unlock(&LOCK_ndb_util_thread);
DBUG_PRINT("exit", ("ndb_util_thread"));
my_thread_end();
pthread_exit(0);
| Thread |
|---|
| • bk commit into 5.1 tree (mskold:1.2375) | Martin Skold | 21 Dec |