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

 3672 Magnus Blåudd	2010-08-13
       - Implement support for millisecond sleep directly in 'NdbSleep_MilliSleep',
        this avoids the need to convert back and forth to microseconds and avoids
        the need to include my_sys for this. The my_sys implementation also has a
        scary busy wait sleep if no select call is found which is now not implemented
        in NdbSleep

=== modified file 'storage/ndb/include/portlib/NdbSleep.h'
--- a/storage/ndb/include/portlib/NdbSleep.h	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/include/portlib/NdbSleep.h	2010-08-13 12:42:51 +0000
@@ -19,25 +19,27 @@
 #ifndef NDBSLEEP_H
 #define NDBSLEEP_H
-#ifdef	__cplusplus
-extern "C" {
 #include <ndb_global.h>
-#include <my_sys.h>
-static inline void NdbSleep_MilliSleep(int milliseconds)
+static inline
+void NdbSleep_MilliSleep(int milliseconds)
-  my_sleep(ulong(milliseconds)*1000UL);
+#ifdef _WIN32
+  Sleep(milliseconds);
+#elif defined(HAVE_SELECT)
+  struct timeval t;
+  t.tv_sec =  milliseconds / 1000L;
+  t.tv_usec = (milliseconds % 1000L) * 1000L;
+  select(0,0,0,0,&t);
+#error No suitable function found to implement millisecond sleep.
-static inline void NdbSleep_SecSleep(int seconds)
+static inline
+void NdbSleep_SecSleep(int seconds)
-#ifdef	__cplusplus

Attachment: [text/bzr-bundle] bzr/
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3672) Magnus Blåudd13 Aug