summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2005-02-04 06:09:43 +0100
committerunknown <joreland@mysql.com>2005-02-04 06:09:43 +0100
commitef5c8dbf7b5e0e4eb6535e6c2c2d40b4a374982d (patch)
tree8f4b07615781cf1548225cc7f14604e11cad6e1d /ndb
parenta6cb0e5ff1c5160f60ebc5303f5c0d898d28dcda (diff)
parent876b4a59b1e72c29061a8ff973d2baa39f2cc6d0 (diff)
downloadmariadb-git-ef5c8dbf7b5e0e4eb6535e6c2c2d40b4a374982d.tar.gz
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1 configure.in: Auto merged ndb/test/src/NDBT_Test.cpp: Auto merged
Diffstat (limited to 'ndb')
-rw-r--r--ndb/include/portlib/NdbThread.h2
-rw-r--r--ndb/src/common/portlib/NdbPortLibTest.cpp16
-rw-r--r--ndb/src/common/portlib/NdbThread.c40
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp5
-rw-r--r--ndb/src/common/util/NdbSqlUtil.cpp28
-rw-r--r--ndb/src/common/util/SocketServer.cpp9
-rw-r--r--ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp3
-rw-r--r--ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp4
-rw-r--r--ndb/src/kernel/vm/FastScheduler.cpp33
-rw-r--r--ndb/src/kernel/vm/ThreadConfig.cpp3
-rw-r--r--ndb/src/kernel/vm/WatchDog.cpp3
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.cpp6
-rw-r--r--ndb/src/mgmsrv/ConfigInfo.cpp14
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp10
-rw-r--r--ndb/src/ndbapi/ClusterMgr.cpp4
-rw-r--r--ndb/src/ndbapi/TransporterFacade.cpp10
-rw-r--r--ndb/src/ndbapi/ndb_cluster_connection.cpp3
-rw-r--r--ndb/test/ndbapi/benchronja.cpp4
-rw-r--r--ndb/test/ndbapi/flexAsynch.cpp3
-rw-r--r--ndb/test/ndbapi/flexBench.cpp5
-rw-r--r--ndb/test/ndbapi/flexHammer.cpp5
-rw-r--r--ndb/test/ndbapi/flexScan.cpp3
-rw-r--r--ndb/test/ndbapi/flexTT.cpp3
-rw-r--r--ndb/test/ndbapi/flexTimedAsynch.cpp3
-rw-r--r--ndb/test/ndbapi/flex_bench_mysql.cpp29
-rw-r--r--ndb/test/ndbapi/mainAsyncGenerator.cpp2
-rw-r--r--ndb/test/src/NDBT_Test.cpp1
-rw-r--r--ndb/test/tools/transproxy.cpp2
28 files changed, 119 insertions, 134 deletions
diff --git a/ndb/include/portlib/NdbThread.h b/ndb/include/portlib/NdbThread.h
index 212f7de9384..e86deee4354 100644
--- a/ndb/include/portlib/NdbThread.h
+++ b/ndb/include/portlib/NdbThread.h
@@ -76,7 +76,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status);
*
* * status: exit code
*/
-void NdbThread_Exit(int status);
+void NdbThread_Exit(void *status);
/**
* Set thread concurrency level
diff --git a/ndb/src/common/portlib/NdbPortLibTest.cpp b/ndb/src/common/portlib/NdbPortLibTest.cpp
index 55b9ccec5f2..d7892411851 100644
--- a/ndb/src/common/portlib/NdbPortLibTest.cpp
+++ b/ndb/src/common/portlib/NdbPortLibTest.cpp
@@ -54,10 +54,7 @@ extern "C" void* thread1func(void* arg)
if (arg1 != 7)
fail("TEST1", "Wrong arg");
- NdbThread_Exit(returnvalue);
-
- return NULL;
-
+ return returnvalue;
}
// test 2 variables and funcs
@@ -80,10 +77,7 @@ extern "C" void* test2func(void* arg)
fail("TEST2", "Failed to unlock mutex");
int returnvalue = arg1;
- NdbThread_Exit(returnvalue);
-
- return NULL;
-
+ return returnvalue;
}
@@ -129,8 +123,7 @@ extern "C" void* testfunc(void* arg)
}
while(tmpVar<100);
- NdbThread_Exit(0);
- return NULL;
+ return 0;
}
extern "C" void* testTryLockfunc(void* arg)
@@ -169,8 +162,7 @@ extern "C" void* testTryLockfunc(void* arg)
}
while(tmpVar<100);
- NdbThread_Exit(0);
- return NULL;
+ return 0;
}
diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c
index 5f2e6021c43..aaee9b45069 100644
--- a/ndb/src/common/portlib/NdbThread.c
+++ b/ndb/src/common/portlib/NdbThread.c
@@ -17,7 +17,7 @@
#include <ndb_global.h>
#include <NdbThread.h>
-#include <pthread.h>
+#include <my_pthread.h>
#include <NdbMem.h>
#define MAX_THREAD_NAME 16
@@ -39,21 +39,28 @@ struct NdbThread
static
void*
ndb_thread_wrapper(void* _ss){
- void * ret;
- struct NdbThread * ss = (struct NdbThread *)_ss;
- DBUG_ENTER("ndb_thread_wrapper");
-#ifdef NDB_SHM_TRANSPORTER
- if (g_ndb_shm_signum)
+ my_thread_init();
{
- sigset_t mask;
- DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum));
- sigemptyset(&mask);
- sigaddset(&mask, g_ndb_shm_signum);
- pthread_sigmask(SIG_BLOCK, &mask, 0);
- }
+ DBUG_ENTER("ndb_thread_wrapper");
+#ifdef NDB_SHM_TRANSPORTER
+ if (g_ndb_shm_signum)
+ {
+ sigset_t mask;
+ DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum));
+ sigemptyset(&mask);
+ sigaddset(&mask, g_ndb_shm_signum);
+ pthread_sigmask(SIG_BLOCK, &mask, 0);
+ }
#endif
- ret= (* ss->func)(ss->object);
- DBUG_RETURN(ret);
+ {
+ void *ret;
+ struct NdbThread * ss = (struct NdbThread *)_ss;
+ ret= (* ss->func)(ss->object);
+ NdbThread_Exit(ret);
+ }
+ /* will never be reached */
+ DBUG_RETURN(0);
+ }
}
@@ -130,9 +137,10 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status)
}
-void NdbThread_Exit(int status)
+void NdbThread_Exit(void *status)
{
- pthread_exit(&status);
+ my_thread_end();
+ pthread_exit(status);
}
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index 462cde76740..439730435ec 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -1104,11 +1104,8 @@ TransporterRegistry::setIOState(NodeId nodeId, IOState state) {
static void *
run_start_clients_C(void * me)
{
- my_thread_init();
((TransporterRegistry*) me)->start_clients_thread();
- my_thread_end();
- NdbThread_Exit(0);
- return me;
+ return 0;
}
// Run by kernel thread
diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp
index 6b23da774af..53fa5d69215 100644
--- a/ndb/src/common/util/NdbSqlUtil.cpp
+++ b/ndb/src/common/util/NdbSqlUtil.cpp
@@ -526,6 +526,7 @@ NdbSqlUtil::cmpDate(const void* info, const Uint32* p1, const Uint32* p2, Uint32
union { const Uint32* p; const unsigned char* v; } u1, u2;
u1.p = p1;
u2.p = p2;
+#ifdef ndb_date_sol9x86_cc_xO3_madness
// from Field_newdate::val_int
Uint64 j1 = uint3korr(u1.v);
Uint64 j2 = uint3korr(u2.v);
@@ -536,6 +537,33 @@ NdbSqlUtil::cmpDate(const void* info, const Uint32* p1, const Uint32* p2, Uint32
if (j1 > j2)
return +1;
return 0;
+#else
+ uint j1 = uint3korr(u1.v);
+ uint j2 = uint3korr(u2.v);
+ uint d1 = (j1 & 31);
+ uint d2 = (j2 & 31);
+ j1 = (j1 >> 5);
+ j2 = (j2 >> 5);
+ uint m1 = (j1 & 15);
+ uint m2 = (j2 & 15);
+ j1 = (j1 >> 4);
+ j2 = (j2 >> 4);
+ uint y1 = j1;
+ uint y2 = j2;
+ if (y1 < y2)
+ return -1;
+ if (y1 > y2)
+ return +1;
+ if (m1 < m2)
+ return -1;
+ if (m1 > m2)
+ return +1;
+ if (d1 < d2)
+ return -1;
+ if (d1 > d2)
+ return +1;
+ return 0;
+#endif
#endif
}
diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp
index 8bee256684d..da06389b5df 100644
--- a/ndb/src/common/util/SocketServer.cpp
+++ b/ndb/src/common/util/SocketServer.cpp
@@ -186,11 +186,7 @@ extern "C"
void*
socketServerThread_C(void* _ss){
SocketServer * ss = (SocketServer *)_ss;
-
- my_thread_init();
ss->doRun();
- my_thread_end();
- NdbThread_Exit(0);
return 0;
}
@@ -309,11 +305,8 @@ void*
sessionThread_C(void* _sc){
SocketServer::Session * si = (SocketServer::Session *)_sc;
- my_thread_init();
if(!transfer(si->m_socket)){
si->m_stopped = true;
- my_thread_end();
- NdbThread_Exit(0);
return 0;
}
@@ -325,8 +318,6 @@ sessionThread_C(void* _sc){
}
si->m_stopped = true;
- my_thread_end();
- NdbThread_Exit(0);
return 0;
}
diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
index ad6c0fd5283..f76440a462a 100644
--- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
@@ -82,7 +82,6 @@ static int numAsyncFiles = 0;
extern "C" void * runAsyncFile(void* arg)
{
- my_thread_init();
((AsyncFile*)arg)->run();
return (NULL);
}
@@ -876,8 +875,6 @@ void AsyncFile::endReq()
{
// Thread is ended with return
if (theWriteBuffer) NdbMem_Free(theWriteBuffer);
- my_thread_end();
- NdbThread_Exit(0);
}
diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp
index aeab9f7828d..b98c60693f4 100644
--- a/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp
@@ -40,7 +40,6 @@ extern "C" void* runProducer(void*arg)
NdbSleep_MilliSleep(i);
i++;
}
- NdbThread_Exit(0);
return NULL;
}
@@ -58,7 +57,6 @@ extern "C" void* runConsumer(void* arg)
delete p;
}
- NdbThread_Exit(0);
return NULL;
}
@@ -92,7 +90,6 @@ extern "C" void* runProducer2(void*arg)
NdbSleep_MilliSleep(i);
i++;
}
- NdbThread_Exit(0);
return NULL;
}
@@ -111,7 +108,6 @@ extern "C" void* runConsumer2(void* arg)
delete p;
}
ndbout << "Consumer2: " << count << " received" << endl;
- NdbThread_Exit(0);
return NULL;
}
diff --git a/ndb/src/kernel/vm/FastScheduler.cpp b/ndb/src/kernel/vm/FastScheduler.cpp
index eca456d26dd..d05c02360a7 100644
--- a/ndb/src/kernel/vm/FastScheduler.cpp
+++ b/ndb/src/kernel/vm/FastScheduler.cpp
@@ -76,19 +76,26 @@ FastScheduler::activateSendPacked()
globalData.loopMax = 2048;
}//FastScheduler::activateSendPacked()
+//------------------------------------------------------------------------
+// sendPacked is executed at the end of the loop.
+// To ensure that we don't send any messages before executing all local
+// packed signals we do another turn in the loop (unless we have already
+// executed too many signals in the loop).
+//------------------------------------------------------------------------
void
FastScheduler::doJob()
{
+ Uint32 init_loopCount = 0;
+ Uint32 TminLoops = getBOccupancy() + EXTRA_SIGNALS_PER_DO_JOB;
+ Uint32 TloopMax = (Uint32)globalData.loopMax;
+ if (TminLoops < TloopMax) {
+ TloopMax = TminLoops;
+ }//if
+ if (TloopMax < MIN_NUMBER_OF_SIG_PER_DO_JOB) {
+ TloopMax = MIN_NUMBER_OF_SIG_PER_DO_JOB;
+ }//if
do{
- Uint32 loopCount = 0;
- Uint32 TminLoops = getBOccupancy() + EXTRA_SIGNALS_PER_DO_JOB;
- Uint32 TloopMax = (Uint32)globalData.loopMax;
- if (TminLoops < TloopMax) {
- TloopMax = TminLoops;
- }//if
- if (TloopMax < MIN_NUMBER_OF_SIG_PER_DO_JOB) {
- TloopMax = MIN_NUMBER_OF_SIG_PER_DO_JOB;
- }//if
+ Uint32 loopCount = init_loopCount;
register Uint32 tHighPrio = globalData.highestAvailablePrio;
register Signal* signal = getVMSignals();
while ((tHighPrio < LEVEL_IDLE) && (loopCount < TloopMax)) {
@@ -151,7 +158,7 @@ FastScheduler::doJob()
if (globalData.sendPackedActivated == 1) {
Uint32 t1 = theDoJobTotalCounter;
Uint32 t2 = theDoJobCallCounter;
- t1 += loopCount;
+ t1 += (loopCount - init_loopCount);
t2++;
theDoJobTotalCounter = t1;
theDoJobCallCounter = t2;
@@ -161,7 +168,11 @@ FastScheduler::doJob()
theDoJobTotalCounter = 0;
}//if
}//if
- } while (getBOccupancy() > MAX_OCCUPANCY);
+ init_loopCount = loopCount;
+ sendPacked();
+ } while ((getBOccupancy() > MAX_OCCUPANCY) ||
+ ((init_loopCount < TloopMax) &&
+ (globalData.highestAvailablePrio < LEVEL_IDLE)));
}//FastScheduler::doJob()
void FastScheduler::sendPacked()
diff --git a/ndb/src/kernel/vm/ThreadConfig.cpp b/ndb/src/kernel/vm/ThreadConfig.cpp
index 4844bb9a477..76fcc4ba84f 100644
--- a/ndb/src/kernel/vm/ThreadConfig.cpp
+++ b/ndb/src/kernel/vm/ThreadConfig.cpp
@@ -173,9 +173,6 @@ void ThreadConfig::ipControlLoop()
// until all buffers are empty or until we have executed 2048 signals.
//--------------------------------------------------------------------
globalScheduler.doJob();
-
- globalScheduler.sendPacked();
-
}//while
globalData.incrementWatchDogCounter(6);
diff --git a/ndb/src/kernel/vm/WatchDog.cpp b/ndb/src/kernel/vm/WatchDog.cpp
index 4e07dc1df90..23475a478d3 100644
--- a/ndb/src/kernel/vm/WatchDog.cpp
+++ b/ndb/src/kernel/vm/WatchDog.cpp
@@ -27,10 +27,7 @@
extern "C"
void*
runWatchDog(void* w){
- my_thread_init();
((WatchDog*)w)->run();
- my_thread_end();
- NdbThread_Exit(0);
return NULL;
}
diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp
index cbf7776fe06..025bed2bc09 100644
--- a/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -457,8 +457,6 @@ event_thread_run(void* m)
{
NdbMgmHandle handle= *(NdbMgmHandle*)m;
- my_thread_init();
-
int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 };
int fd = ndb_mgm_listen_event(handle, filter);
if (fd > 0)
@@ -478,9 +476,7 @@ event_thread_run(void* m)
do_event_thread= -1;
}
- my_thread_end();
- NdbThread_Exit(0);
- return 0;
+ return NULL;
}
bool
diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp
index 9be4af1b9b5..07310e3a8b8 100644
--- a/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -3192,13 +3192,27 @@ fixShmKey(InitConfigFileParser::Context & ctx, const char *)
{
DBUG_ENTER("fixShmKey");
{
+ static int last_signum= -1;
Uint32 signum;
if(!ctx.m_currentSection->get("Signum", &signum))
{
signum= OPT_NDB_SHM_SIGNUM_DEFAULT;
+ if (signum <= 0)
+ {
+ ctx.reportError("Unable to set default parameter for [SHM]Signum"
+ " please specify [SHM DEFAULT]Signum");
+ return false;
+ }
ctx.m_currentSection->put("Signum", signum);
DBUG_PRINT("info",("Added Signum=%u", signum));
}
+ if ( last_signum != (int)signum && last_signum >= 0 )
+ {
+ ctx.reportError("All shared memory transporters must have same [SHM]Signum defined."
+ " Use [SHM DEFAULT]Signum");
+ return false;
+ }
+ last_signum= (int)signum;
}
{
Uint32 id1= 0, id2= 0, key= 0;
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index f698099141a..66c9a6448aa 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -70,12 +70,7 @@ void *
MgmtSrvr::logLevelThread_C(void* m)
{
MgmtSrvr *mgm = (MgmtSrvr*)m;
- my_thread_init();
mgm->logLevelThreadRun();
-
- my_thread_end();
- NdbThread_Exit(0);
- /* NOTREACHED */
return 0;
}
@@ -83,12 +78,7 @@ void *
MgmtSrvr::signalRecvThread_C(void *m)
{
MgmtSrvr *mgm = (MgmtSrvr*)m;
- my_thread_init();
mgm->signalRecvThreadRun();
-
- my_thread_end();
- NdbThread_Exit(0);
- /* NOTREACHED */
return 0;
}
diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp
index e10b2e1d82c..1fe0cedbd6c 100644
--- a/ndb/src/ndbapi/ClusterMgr.cpp
+++ b/ndb/src/ndbapi/ClusterMgr.cpp
@@ -54,7 +54,6 @@ runClusterMgr_C(void * me)
#ifdef NDB_OSE
NdbSleep_MilliSleep(50);
#endif
- NdbThread_Exit(0);
return NULL;
}
@@ -560,10 +559,7 @@ extern "C"
void*
runArbitMgr_C(void* me)
{
- my_thread_init();
((ArbitMgr*) me)->threadMain();
- my_thread_end();
- NdbThread_Exit(0);
return NULL;
}
diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp
index 031ee6315e8..5582143be44 100644
--- a/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/ndb/src/ndbapi/TransporterFacade.cpp
@@ -405,11 +405,8 @@ extern "C"
void*
runSendRequest_C(void * me)
{
- my_thread_init();
((TransporterFacade*) me)->threadMainSend();
- my_thread_end();
- NdbThread_Exit(0);
- return me;
+ return 0;
}
void TransporterFacade::threadMainSend(void)
@@ -443,11 +440,8 @@ extern "C"
void*
runReceiveResponse_C(void * me)
{
- my_thread_init();
((TransporterFacade*) me)->threadMainReceive();
- my_thread_end();
- NdbThread_Exit(0);
- return me;
+ return 0;
}
void TransporterFacade::threadMainReceive(void)
diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp
index 5df707e211d..ab32d6abb8e 100644
--- a/ndb/src/ndbapi/ndb_cluster_connection.cpp
+++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp
@@ -87,11 +87,8 @@ const char *Ndb_cluster_connection::get_connectstring(char *buf,
extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me)
{
- my_thread_init();
g_run_connect_thread= 1;
((Ndb_cluster_connection_impl*) me)->connect_thread();
- my_thread_end();
- NdbThread_Exit(0);
return me;
}
diff --git a/ndb/test/ndbapi/benchronja.cpp b/ndb/test/ndbapi/benchronja.cpp
index 91b2a041186..a7523e8e416 100644
--- a/ndb/test/ndbapi/benchronja.cpp
+++ b/ndb/test/ndbapi/benchronja.cpp
@@ -984,7 +984,6 @@ void* ThreadExec(void* ThreadData){
delete pMyNdb;
pMyNdb = NULL ;
ThreadReady[thread_no] = 1;
- NdbThread_Exit(0) ;
return 0 ;
}//if
@@ -1197,7 +1196,6 @@ void* ThreadExec(void* ThreadData){
} // for(;;)
delete pMyNdb ;
- NdbThread_Exit(0) ;
- return 0 ; // Compiler is happy now
+ return 0 ;
}
diff --git a/ndb/test/ndbapi/flexAsynch.cpp b/ndb/test/ndbapi/flexAsynch.cpp
index 1953444d640..4b87b2c70ed 100644
--- a/ndb/test/ndbapi/flexAsynch.cpp
+++ b/ndb/test/ndbapi/flexAsynch.cpp
@@ -494,8 +494,7 @@ threadLoop(void* ThreadData)
delete localNdb;
ThreadReady[threadNo] = 1;
- NdbThread_Exit(0);
- return NULL; // Just to keep compiler happy
+ return NULL;
}//threadLoop()
static
diff --git a/ndb/test/ndbapi/flexBench.cpp b/ndb/test/ndbapi/flexBench.cpp
index 2a2388109a1..cc2bfb391da 100644
--- a/ndb/test/ndbapi/flexBench.cpp
+++ b/ndb/test/ndbapi/flexBench.cpp
@@ -617,7 +617,7 @@ static void* flexBenchThread(void* pArg)
free(attrRefValue) ;
free(pOps) ;
delete pNdb ;
- NdbThread_Exit(0) ;
+ return 0; // thread exits
}
pNdb->init();
@@ -934,8 +934,7 @@ static void* flexBenchThread(void* pArg)
free(longKeyAttrValue);
} // if
- NdbThread_Exit(0);
- return NULL; // Just to keep compiler happy
+ return NULL; // Thread exits
}
diff --git a/ndb/test/ndbapi/flexHammer.cpp b/ndb/test/ndbapi/flexHammer.cpp
index 688e70d501a..13cd2d5e561 100644
--- a/ndb/test/ndbapi/flexHammer.cpp
+++ b/ndb/test/ndbapi/flexHammer.cpp
@@ -612,10 +612,7 @@ flexHammerThread(void* pArg)
flexHammerErrorData->resetErrorCounters();
- // And exit using NDBT
- NdbThread_Exit(0);
-
- return NULL;
+ return NULL; // thread exits
} // flexHammerThread
diff --git a/ndb/test/ndbapi/flexScan.cpp b/ndb/test/ndbapi/flexScan.cpp
index c7f4041a525..4d2c85d6955 100644
--- a/ndb/test/ndbapi/flexScan.cpp
+++ b/ndb/test/ndbapi/flexScan.cpp
@@ -701,8 +701,7 @@ flexScanThread(void* ThreadData)
free(pkValue);
} // if
- NdbThread_Exit(0);
- return NULL;
+ return NULL; // thread exits
} // flexScanThread
diff --git a/ndb/test/ndbapi/flexTT.cpp b/ndb/test/ndbapi/flexTT.cpp
index 3b976f9f87e..8d5be2bb399 100644
--- a/ndb/test/ndbapi/flexTT.cpp
+++ b/ndb/test/ndbapi/flexTT.cpp
@@ -389,8 +389,7 @@ threadLoop(void* ThreadData)
delete localNdb;
ThreadReady[loc_threadNo] = 1;
- NdbThread_Exit(0);
- return NULL; // Just to keep compiler happy
+ return NULL; // Thread exits
}//threadLoop()
static
diff --git a/ndb/test/ndbapi/flexTimedAsynch.cpp b/ndb/test/ndbapi/flexTimedAsynch.cpp
index 27380cc79fd..2b8c0bdd5f8 100644
--- a/ndb/test/ndbapi/flexTimedAsynch.cpp
+++ b/ndb/test/ndbapi/flexTimedAsynch.cpp
@@ -406,9 +406,8 @@ threadLoop(void* ThreadData)
delete localNdb;
ThreadReady[threadNo] = 1;
- NdbThread_Exit(0);
- return NULL;
+ return NULL; // thread exits
}
void executeThread(StartType aType, Ndb* aNdbObject, ThreadNdb* threadInfo)
diff --git a/ndb/test/ndbapi/flex_bench_mysql.cpp b/ndb/test/ndbapi/flex_bench_mysql.cpp
index c8d4d85bedf..c15175bfb00 100644
--- a/ndb/test/ndbapi/flex_bench_mysql.cpp
+++ b/ndb/test/ndbapi/flex_bench_mysql.cpp
@@ -710,7 +710,7 @@ static void* flexBenchThread(void* pArg)
the_socket_name,
0) == NULL ) {
ndbout << "failed" << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
ndbout << "ok" << endl;
@@ -722,7 +722,7 @@ static void* flexBenchThread(void* pArg)
if (r) {
ndbout << "autocommit on/off failed" << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
}
#endif
@@ -741,7 +741,7 @@ static void* flexBenchThread(void* pArg)
ndbout << threadNo << endl ;
ndbout << "Thread #" << threadNo << " will now exit" << endl ;
tResult = 13 ;
- NdbThread_Exit(0) ;
+ return 0;
}
if (use_ndb) {
@@ -750,7 +750,7 @@ static void* flexBenchThread(void* pArg)
ndbout << "Failed to get an NDB object" << endl;
ndbout << "Thread #" << threadNo << " will now exit" << endl ;
tResult = 13;
- NdbThread_Exit(0) ;
+ return 0;
}
pNdb->waitUntilReady();
return_ndb_object(pNdb, ndb_id);
@@ -900,11 +900,11 @@ static void* flexBenchThread(void* pArg)
prep_insert[i] = mysql_prepare(&mysql, buf, pos);
if (prep_insert[i] == 0) {
ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
if (mysql_bind_param(prep_insert[i], bind_insert)) {
ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
}
@@ -926,11 +926,11 @@ static void* flexBenchThread(void* pArg)
prep_update[i] = mysql_prepare(&mysql, buf, pos);
if (prep_update[i] == 0) {
ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
if (mysql_bind_param(prep_update[i], bind_update)) {
ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
}
@@ -953,15 +953,15 @@ static void* flexBenchThread(void* pArg)
prep_read[i] = mysql_prepare(&mysql, buf, pos);
if (prep_read[i] == 0) {
ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
if (mysql_bind_param(prep_read[i], bind_read)) {
ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
if (mysql_bind_result(prep_read[i], &bind_read[1])) {
ndbout << "mysql_bind_result: " << mysql_error(&mysql) << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
}
@@ -978,11 +978,11 @@ static void* flexBenchThread(void* pArg)
prep_delete[i] = mysql_prepare(&mysql, buf, pos);
if (prep_delete[i] == 0) {
ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
if (mysql_bind_param(prep_delete[i], bind_delete)) {
ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl;
- NdbThread_Exit(0) ;
+ return 0;
}
}
}
@@ -1431,8 +1431,7 @@ static void* flexBenchThread(void* pArg)
ndbout << "I got here " << endl;
return_ndb_object(pNdb, ndb_id);
}
- NdbThread_Exit(0);
- return NULL; // Just to keep compiler happy
+ return NULL;
}
diff --git a/ndb/test/ndbapi/mainAsyncGenerator.cpp b/ndb/test/ndbapi/mainAsyncGenerator.cpp
index 16cb50e160f..73a8b98ab57 100644
--- a/ndb/test/ndbapi/mainAsyncGenerator.cpp
+++ b/ndb/test/ndbapi/mainAsyncGenerator.cpp
@@ -274,8 +274,6 @@ threadRoutine(void *arg)
asyncDbDisconnect(pNDB);
- NdbThread_Exit(0);
-
return NULL;
}
diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp
index 0e5f744d5ea..600a5443f40 100644
--- a/ndb/test/src/NDBT_Test.cpp
+++ b/ndb/test/src/NDBT_Test.cpp
@@ -479,7 +479,6 @@ void *
runStep_C(void * s)
{
runStep(s);
- NdbThread_Exit(0);
return NULL;
}
diff --git a/ndb/test/tools/transproxy.cpp b/ndb/test/tools/transproxy.cpp
index 88267801172..28a621fa584 100644
--- a/ndb/test/tools/transproxy.cpp
+++ b/ndb/test/tools/transproxy.cpp
@@ -291,7 +291,6 @@ extern "C" void*
copyrun_C(void* copy)
{
((Copy*) copy)->run();
- NdbThread_Exit(0);
return 0;
}
@@ -322,7 +321,6 @@ extern "C" void*
connrun_C(void* conn)
{
((Conn*) conn)->run();
- NdbThread_Exit(0);
return 0;
}