3817 Magnus Blåudd 2010-09-22 [merge]
Merge 7.0 -> 7.1
modified:
storage/ndb/src/kernel/ndbd.cpp
3816 Magnus Blåudd 2010-09-22 [merge]
Merge 7.0 -> 7.1
modified:
storage/ndb/include/portlib/NdbCondition.h
storage/ndb/src/common/portlib/NdbCondition.c
storage/ndb/src/common/util/ndb_init.cpp
storage/ndb/src/kernel/vm/mt.cpp
=== modified file 'storage/ndb/src/kernel/ndbd.cpp'
--- a/storage/ndb/src/kernel/ndbd.cpp 2010-08-20 08:35:41 +0000
+++ b/storage/ndb/src/kernel/ndbd.cpp 2010-09-22 09:19:56 +0000
@@ -404,9 +404,11 @@ extern "C"
void
handler_error(int signum){
// only let one thread run shutdown
- static long thread_id= 0;
+ static bool handling_error = false;
+ static pthread_t thread_id; // Valid when handling_error is true
- if (thread_id != 0 && thread_id == my_thread_id())
+ if (handling_error &&
+ pthread_equal(thread_id, pthread_self()))
{
// Shutdown thread received signal
#ifndef NDB_WIN32
@@ -419,7 +421,10 @@ handler_error(int signum){
if(theShutdownMutex && NdbMutex_Trylock(theShutdownMutex) != 0)
while(true)
NdbSleep_MilliSleep(10);
- thread_id= my_thread_id();
+
+ thread_id = pthread_self();
+ handling_error = true;
+
g_eventLogger->info("Received signal %d. Running error handler.", signum);
childReportSignal(signum);
// restart the system
Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20100922092233-pamwerflnbglnfou.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.1 branch (magnus.blaudd:3816 to 3817) | Magnus Blåudd | 22 Sep |