summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2005-01-19 07:34:57 +0100
committerunknown <joreland@mysql.com>2005-01-19 07:34:57 +0100
commitbfe74e69903583f1bb9b4ad803c137d6487afa74 (patch)
treedc47234a96dff449dbaa9b7cb44976c9d564da35
parenta8e5250060a5703cd01c3940abf244eab7669893 (diff)
parent153160d1ffd9d118867c3e5c41474f435e5c981f (diff)
downloadmariadb-git-bfe74e69903583f1bb9b4ad803c137d6487afa74.tar.gz
Merge mysql.com:/home/jonas/src/mysql-4.1
into mysql.com:/home/jonas/src/mysql-5.0 configure.in: Auto merged ndb/src/common/transporter/TransporterRegistry.cpp: Auto merged sql/ha_ndbcluster.cc: Auto merged
-rw-r--r--configure.in7
-rw-r--r--ndb/src/common/portlib/NdbThread.c22
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp16
-rw-r--r--sql/ha_ndbcluster.cc4
4 files changed, 41 insertions, 8 deletions
diff --git a/configure.in b/configure.in
index 5366254fc4c..ec1a4615fa8 100644
--- a/configure.in
+++ b/configure.in
@@ -1922,7 +1922,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
realpath rename rint rwlock_init setupterm \
- shmget shmat shmdt shmctl sigaction \
+ shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
sighold sigset sigthreadmask \
snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr)
@@ -2709,7 +2709,10 @@ if test "$ac_cv_func_shmget" = "yes" &&
test "$ac_cv_func_shmat" = "yes" &&
test "$ac_cv_func_shmdt" = "yes" &&
test "$ac_cv_func_shmctl" = "yes" &&
- test "$ac_cv_func_sigaction" = "yes"
+ test "$ac_cv_func_sigaction" = "yes" &&
+ test "$ac_cv_func_sigemptyset" = "yes" &&
+ test "$ac_cv_func_sigaddset" = "yes" &&
+ test "$ac_cv_func_pthread_sigmask" = "yes"
then
AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
[Including Ndb Cluster DB shared memory transporter])
diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c
index d4f6617d2f5..8cd6c306514 100644
--- a/ndb/src/common/portlib/NdbThread.c
+++ b/ndb/src/common/portlib/NdbThread.c
@@ -28,8 +28,24 @@ struct NdbThread
{
pthread_t thread;
char thread_name[MAX_THREAD_NAME];
+ NDB_THREAD_FUNC * func;
+ void * object;
};
+static
+void*
+ndb_thread_wrapper(void* _ss){
+ void * ret;
+ struct NdbThread * ss = (struct NdbThread *)_ss;
+#ifdef NDB_SHM_TRANSPORTER
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGUSR1);
+ pthread_sigmask(SIG_BLOCK, &mask, 0);
+#endif
+ ret= (* ss->func)(ss->object);
+ return ret;
+}
struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
@@ -67,10 +83,12 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
#ifdef PTHREAD_CREATE_JOINABLE /* needed on SCO */
pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
#endif
+ tmpThread->func= p_thread_func;
+ tmpThread->object= p_thread_arg;
result = pthread_create(&tmpThread->thread,
&thread_attr,
- p_thread_func,
- p_thread_arg);
+ ndb_thread_wrapper,
+ tmpThread);
assert(result==0);
pthread_attr_destroy(&thread_attr);
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index fcc7a62d9e9..215b2a05f63 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -157,8 +157,17 @@ TransporterRegistry::init(NodeId nodeId) {
DEBUG("TransporterRegistry started node: " << localNodeId);
- // return allocateLongSignalMemoryPool(nLargeSegments);
- return true;
+#ifdef NDB_SHM_TRANSPORTER
+ /**
+ * Make sure to block SIGUSR1
+ * TransporterRegistry::init is run from "main" thread
+ */
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGUSR1);
+ pthread_sigmask(SIG_BLOCK, &mask, 0);
+#endif
+return true;
}
bool
@@ -1347,6 +1356,9 @@ TransporterRegistry::startReceiving()
#ifdef NDB_SHM_TRANSPORTER
m_shm_own_pid = getpid();
struct sigaction sa;
+ sigemptyset(&sa.sa_mask);
+ sigaddset(&sa.sa_mask, SIGUSR1);
+ pthread_sigmask(SIG_UNBLOCK, &sa.sa_mask, 0);
sa.sa_handler = shm_sig_handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index aa39af5176e..a6f7630321b 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -616,7 +616,7 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob)
char *buf= m_blobs_buffer + offset;
uint32 len= 0xffffffff; // Max uint32
DBUG_PRINT("value", ("read blob ptr=%x len=%u",
- (uint)buf, (uint)blob_len));
+ (UintPtr)buf, (uint)blob_len));
if (ndb_blob->readData(buf, len) != 0)
DBUG_RETURN(-1);
DBUG_ASSERT(len == blob_len);
@@ -3222,7 +3222,7 @@ int ha_ndbcluster::start_stmt(THD *thd)
#if 0
NdbTransaction *tablock_trans=
(NdbTransaction*)thd->transaction.all.ndb_tid;
- DBUG_PRINT("info", ("tablock_trans: %x", (uint)tablock_trans));
+ DBUG_PRINT("info", ("tablock_trans: %x", (UintPtr)tablock_trans));
DBUG_ASSERT(tablock_trans);
// trans= ndb->hupp(tablock_trans);
#endif