List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:August 17 2010 11:50am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3685)
View as plain text  
#At file:///home/msvensson/mysql/7.0-seagull/ based on revid:magnus.blaudd@stripped

 3685 Magnus Blåudd	2010-08-17
      ndb
       - my_thread_id is not a function but simply a typedef. Wonder how it worked
         at all(maybe it didn't)?
      - Use pthread_self and pthread_equal to implement
        the desired behaviour.

    modified:
      storage/ndb/src/kernel/ndbd.cpp
=== modified file 'storage/ndb/src/kernel/ndbd.cpp'
--- a/storage/ndb/src/kernel/ndbd.cpp	2010-08-17 09:04:41 +0000
+++ b/storage/ndb/src/kernel/ndbd.cpp	2010-08-17 11:50:55 +0000
@@ -406,9 +406,10 @@ extern "C"
 void
 handler_error(int signum){
   // only let one thread run shutdown
-  static long thread_id= 0;
+  static pthread_t thread_id = 0;
 
-  if (thread_id != 0 && thread_id == my_thread_id())
+  if (thread_id != 0 &&
+      pthread_equal(thread_id, pthread_self()))
   {
     // Shutdown thread received signal
 #ifndef NDB_WIN32
@@ -421,7 +422,7 @@ handler_error(int signum){
   if(theShutdownMutex && NdbMutex_Trylock(theShutdownMutex) != 0)
     while(true)
       NdbSleep_MilliSleep(10);
-  thread_id= my_thread_id();
+  thread_id = pthread_self();
   g_eventLogger->info("Received signal %d. Running error handler.", signum);
   childReportSignal(signum);
   // restart the system

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20100817115055-dlb1tpuh1ym5as5n.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3685) Magnus Blåudd17 Aug