Loading acinclude.m4 +6 −1 Original line number Diff line number Diff line Loading @@ -1624,6 +1624,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ --without-ndb-debug Disable special ndb debug features], [ndb_debug="$withval"], [ndb_debug="default"]) AC_ARG_WITH([ndb-ccflags], [ --with-ndb-ccflags Extra CC options for ndb compile], [ndb_cxxflags_fix="$ndb_cxxflags_fix $withval"], [ndb_cxxflags_fix=$ndb_cxxflags_fix]) AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) Loading include/my_global.h +6 −0 Original line number Diff line number Diff line Loading @@ -135,7 +135,13 @@ #ifdef HAVE_UNIXWARE7_THREADS #include <thread.h> #else #if defined(HPUX10) || defined(HPUX11) C_MODE_START /* HPUX needs this, signal.h bug */ #include <pthread.h> C_MODE_END #else #include <pthread.h> /* AIX must have this included first */ #endif #endif /* HAVE_UNIXWARE7_THREADS */ #endif /* HAVE_mit_thread */ #if !defined(SCO) && !defined(_REENTRANT) 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,15 @@ 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); NdbThread_Exit(ret); } /* will never be reached */ DBUG_RETURN(0); } } Loading Loading @@ -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); } Loading Loading
acinclude.m4 +6 −1 Original line number Diff line number Diff line Loading @@ -1624,6 +1624,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ --without-ndb-debug Disable special ndb debug features], [ndb_debug="$withval"], [ndb_debug="default"]) AC_ARG_WITH([ndb-ccflags], [ --with-ndb-ccflags Extra CC options for ndb compile], [ndb_cxxflags_fix="$ndb_cxxflags_fix $withval"], [ndb_cxxflags_fix=$ndb_cxxflags_fix]) AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) Loading
include/my_global.h +6 −0 Original line number Diff line number Diff line Loading @@ -135,7 +135,13 @@ #ifdef HAVE_UNIXWARE7_THREADS #include <thread.h> #else #if defined(HPUX10) || defined(HPUX11) C_MODE_START /* HPUX needs this, signal.h bug */ #include <pthread.h> C_MODE_END #else #include <pthread.h> /* AIX must have this included first */ #endif #endif /* HAVE_UNIXWARE7_THREADS */ #endif /* HAVE_mit_thread */ #if !defined(SCO) && !defined(_REENTRANT) 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,15 @@ 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); NdbThread_Exit(ret); } /* will never be reached */ DBUG_RETURN(0); } } Loading Loading @@ -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); } Loading