List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:October 12 2010 12:02pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jonas:3847)
View as plain text  
#At file:///home/jonas/src/telco-7.0/ based on revid:jonas@stripped

 3847 Jonas Oreland	2010-10-12
      ndb - make all callers of TransporterRegistry::pollReceive(), performReceive() use same method, TransporterFacade::external_poll

    modified:
      storage/ndb/src/ndbapi/TransporterFacade.cpp
=== modified file 'storage/ndb/src/ndbapi/TransporterFacade.cpp'
--- a/storage/ndb/src/ndbapi/TransporterFacade.cpp	2010-10-06 12:35:34 +0000
+++ b/storage/ndb/src/ndbapi/TransporterFacade.cpp	2010-10-12 12:02:53 +0000
@@ -489,10 +489,9 @@ void TransporterFacade::threadMainReceiv
     for(int i = 0; i<10; i++){
       NdbSleep_MilliSleep(10);
       NdbMutex_Lock(theMutexPtr);
-      if (m_poll_owner == NULL) {
-        const int res = theTransporterRegistry->pollReceive(0);
-        if(res > 0)
-          theTransporterRegistry->performReceive();
+      if (m_poll_owner == NULL)
+      {
+        external_poll(0);
       }
       NdbMutex_Unlock(theMutexPtr);
     }
@@ -511,9 +510,25 @@ void TransporterFacade::threadMainReceiv
 void TransporterFacade::external_poll(Uint32 wait_time)
 {
   NdbMutex_Unlock(theMutexPtr);
+
+#ifdef NDB_SHM_TRANSPORTER
+  /*
+    If shared memory transporters are used we need to set our sigmask
+    such that we wake up also on interrupts on the shared memory
+    interrupt signal.
+  */
+  NdbThread_set_shm_sigmask(FALSE);
+#endif
+
   const int res = theTransporterRegistry->pollReceive(wait_time);
+
+#ifdef NDB_SHM_TRANSPORTER
+  NdbThread_set_shm_sigmask(TRUE);
+#endif
+
   NdbMutex_Lock(theMutexPtr);
-  if (res > 0) {
+  if (res > 0)
+  {
     theTransporterRegistry->performReceive();
   }
 }
@@ -1580,28 +1595,10 @@ TransporterFacade::do_poll(trp_client* c
       receiving data we will check if all data is received, if not we
       poll again.
     */
-#ifdef NDB_SHM_TRANSPORTER
-    /*
-      If shared memory transporters are used we need to set our sigmask
-      such that we wake up also on interrupts on the shared memory
-      interrupt signal.
-    */
-    NdbThread_set_shm_sigmask(FALSE);
-#endif
     assert(owner == clnt || clnt->m_poll.m_poll_owner == false);
     m_poll_owner = clnt;
     clnt->m_poll.m_poll_owner = true;
-    NdbMutex_Unlock(theMutexPtr);
-    const int res = theTransporterRegistry->pollReceive(wait_time);
-#ifdef NDB_SHM_TRANSPORTER
-    NdbThread_set_shm_sigmask(TRUE);
-#endif
-
-    NdbMutex_Lock(theMutexPtr);
-    if (res > 0)
-    {
-      theTransporterRegistry->performReceive();
-    }
+    external_poll(wait_time);
   }
 }
 


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20101012120253-oaa0ul449a8y75o2.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:3847) Jonas Oreland12 Oct