- rename sleep to delayExecution
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 4 Sep 2007 09:36:00 +0000 (09:36 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 4 Sep 2007 09:36:00 +0000 (09:36 +0000)
- delayExecution accepts the value now in seconds
- should fix the linux crash

svn path=/trunk/; revision=28831

reactos/tools/sysreg/os_support.cpp
reactos/tools/sysreg/os_support.h
reactos/tools/sysreg/rosboot_test.cpp

index 7b43de4..5f2e706 100644 (file)
@@ -87,9 +87,9 @@ namespace System_
                free(cmd);
                return pid;
        }
-       void OsSupport::sleep(long value)
+       void OsSupport::delayExecution(long value)
        {
-               Sleep(value);
+               Sleep(value * 1000);
        }
 #else
 /********************************************************************************************************************/
@@ -124,9 +124,9 @@ namespace System_
                return true;
        }
 
-       void OsSupport::sleep(long value)
+       void OsSupport::delayExecution(long value)
        {
-               sleep(value);
+                       sleep( (clock_t)m_Delayread * CLOCKS_PER_SEC );
        }
 
 
index 85cb2c9..727703e 100644 (file)
@@ -77,7 +77,16 @@ namespace System_
 
        static bool terminateProcess(ProcessID pid);
 
-    static void sleep(long value);
+
+//----------------------------------------------------------------------------------------
+///
+/// delayExecution
+///
+/// Description: this function sleeps the current process for the amount given in seconds
+///
+/// @param sec amount of seconds to sleep
+
+    static void delayExecution(long sec);
 
        protected:
 //---------------------------------------------------------------------------------------
index acec7d6..0f319e6 100644 (file)
@@ -94,7 +94,7 @@ namespace Sysreg_
                        /// delay reading until emulator is ready
                        ///
 
-            OsSupport::sleep(m_DelayRead);
+            OsSupport::delayExecution(m_DelayRead);
                }
     }
 //---------------------------------------------------------------------------------------
@@ -600,7 +600,7 @@ namespace Sysreg_
        void RosBootTest::cleanup()
        {
         m_DataSource->closeSource();
-        OsSupport::sleep(3 * CLOCKS_PER_SEC);
+        OsSupport::delayExecution(3);
 
         if (m_Pid)
         {
@@ -650,7 +650,7 @@ namespace Sysreg_
         }
 #endif
 #ifndef __LINUX__
-        OsSupport::sleep(500);
+        OsSupport::delayExecution(1);
 #endif
 
        assert(m_DataSource != 0);
@@ -660,8 +660,15 @@ namespace Sysreg_
             cleanup();
             return false;
         }
-        OsSupport::sleep(1000); 
 #ifdef __LINUX__
+        
+        OsSupport::delayExecution(3); 
+        /*
+         * For linux systems we can only
+         * check if the emulator runs by
+         * opening pid.txt and lookthrough if
+         * it exists
+         */
 
         FILE * file = fopen(m_PidFile.c_str(), "r");
         if (!file)