Loading ndb/include/portlib/NdbThread.h +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading ndb/src/common/portlib/NdbPortLibTest.cpp +4 −12 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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; } Loading Loading @@ -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) Loading Loading @@ -169,8 +162,7 @@ extern "C" void* testTryLockfunc(void* arg) } while(tmpVar<100); NdbThread_Exit(0); return NULL; return 0; } Loading ndb/src/common/portlib/NdbThread.c +24 −16 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -39,8 +39,8 @@ struct NdbThread static void* ndb_thread_wrapper(void* _ss){ void * ret; struct NdbThread * ss = (struct NdbThread *)_ss; my_thread_init(); { DBUG_ENTER("ndb_thread_wrapper"); #ifdef NDB_SHM_TRANSPORTER if (g_ndb_shm_signum) Loading @@ -52,8 +52,16 @@ ndb_thread_wrapper(void* _ss){ pthread_sigmask(SIG_BLOCK, &mask, 0); } #endif { void *ret; struct NdbThread * ss = (struct NdbThread *)_ss; ret= (* ss->func)(ss->object); DBUG_RETURN(ret); my_thread_end(); NdbThread_Exit(ret); } /* will never be reached */ DBUG_RETURN(0); } } Loading Loading @@ -130,9 +138,9 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status) } void NdbThread_Exit(int status) void NdbThread_Exit(void *status) { pthread_exit(&status); pthread_exit(status); } Loading ndb/src/common/transporter/TransporterRegistry.cpp +1 −4 Original line number Diff line number Diff line Loading @@ -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 Loading ndb/src/common/util/SocketServer.cpp +0 −9 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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; } Loading @@ -325,8 +318,6 @@ sessionThread_C(void* _sc){ } si->m_stopped = true; my_thread_end(); NdbThread_Exit(0); return 0; } Loading Loading
ndb/include/portlib/NdbThread.h +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
ndb/src/common/portlib/NdbPortLibTest.cpp +4 −12 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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; } Loading Loading @@ -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) Loading Loading @@ -169,8 +162,7 @@ extern "C" void* testTryLockfunc(void* arg) } while(tmpVar<100); NdbThread_Exit(0); return NULL; return 0; } Loading
ndb/src/common/portlib/NdbThread.c +24 −16 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -39,8 +39,8 @@ struct NdbThread static void* ndb_thread_wrapper(void* _ss){ void * ret; struct NdbThread * ss = (struct NdbThread *)_ss; my_thread_init(); { DBUG_ENTER("ndb_thread_wrapper"); #ifdef NDB_SHM_TRANSPORTER if (g_ndb_shm_signum) Loading @@ -52,8 +52,16 @@ ndb_thread_wrapper(void* _ss){ pthread_sigmask(SIG_BLOCK, &mask, 0); } #endif { void *ret; struct NdbThread * ss = (struct NdbThread *)_ss; ret= (* ss->func)(ss->object); DBUG_RETURN(ret); my_thread_end(); NdbThread_Exit(ret); } /* will never be reached */ DBUG_RETURN(0); } } Loading Loading @@ -130,9 +138,9 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status) } void NdbThread_Exit(int status) void NdbThread_Exit(void *status) { pthread_exit(&status); pthread_exit(status); } Loading
ndb/src/common/transporter/TransporterRegistry.cpp +1 −4 Original line number Diff line number Diff line Loading @@ -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 Loading
ndb/src/common/util/SocketServer.cpp +0 −9 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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; } Loading @@ -325,8 +318,6 @@ sessionThread_C(void* _sc){ } si->m_stopped = true; my_thread_end(); NdbThread_Exit(0); return 0; } Loading