MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:pekka Date:February 4 2008 8:24am
Subject:bk commit into 5.0 tree (pekka:1.2594) BUG#34169
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of pekka.  When pekka does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-02-04 09:23:56+01:00, pekka@stripped +2 -0
  bug#34169 - fix pthread_t abuse

  ndb/src/ndbapi/Ndb.cpp@stripped, 2008-02-04 09:22:09+01:00, pekka@stripped +1 -5
    fix pthread_t abuse

  ndb/test/ndbapi/testOIBasic.cpp@stripped, 2008-02-04 09:22:09+01:00, pekka@stripped +4 -5
    fix pthread_t abuse

diff -Nrup a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp
--- a/ndb/src/ndbapi/Ndb.cpp	2008-01-22 15:04:45 +01:00
+++ b/ndb/src/ndbapi/Ndb.cpp	2008-02-04 09:22:09 +01:00
@@ -1466,11 +1466,7 @@ Ndb::printState(const char* fmt, ...)
   NdbMutex_Lock(ndb_print_state_mutex);
   bool dups = false;
   unsigned i;
-  ndbout << buf << " ndb=" << hex << this << dec;
-#ifndef NDB_WIN32
-  ndbout << " thread=" << (int)pthread_self();
-#endif
-  ndbout << endl;
+  ndbout << buf << " ndb=" << hex << (void*)this << endl;
   for (unsigned n = 0; n < MAX_NDB_NODES; n++) {
     NdbTransaction* con = theConnectionArray[n];
     if (con != 0) {
diff -Nrup a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp
--- a/ndb/test/ndbapi/testOIBasic.cpp	2008-01-27 15:01:36 +01:00
+++ b/ndb/test/ndbapi/testOIBasic.cpp	2008-02-04 09:22:09 +01:00
@@ -4909,7 +4909,7 @@ struct Thr {
   enum State { Wait, Start, Stop, Exit };
   State m_state;
   Par m_par;
-  Uint64 m_id;
+  pthread_t m_id;
   NdbThread* m_thread;
   NdbMutex* m_mutex;
   NdbCondition* m_cond;
@@ -4945,7 +4945,6 @@ struct Thr {
 Thr::Thr(Par par, uint n) :
   m_state(Wait),
   m_par(par),
-  m_id(0),
   m_thread(0),
   m_mutex(0),
   m_cond(0),
@@ -4987,7 +4986,7 @@ static void*
 runthread(void* arg)
 {
   Thr& thr = *(Thr*)arg;
-  thr.m_id = (Uint64)pthread_self();
+  thr.m_id = pthread_self();
   if (thr.run() < 0) {
     LL1("exit on error");
   } else {
@@ -5069,11 +5068,11 @@ static Thr*
 getthr()
 {
   if (g_thrlist != 0) {
-    Uint64 id = (Uint64)pthread_self();
+    pthread_t id = pthread_self();
     for (uint n = 0; n < g_opt.m_threads; n++) {
       if (g_thrlist[n] != 0) {
         Thr& thr = *g_thrlist[n];
-        if (thr.m_id == id)
+        if (pthread_equal(thr.m_id, id))
           return &thr;
       }
     }
Thread
bk commit into 5.0 tree (pekka:1.2594) BUG#34169pekka4 Feb