From 9b5863ddfbd704dd6886f4b6c2318c789fe2367d Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Tue, 4 Sep 2007 09:36:00 +0000 Subject: [PATCH] - rename sleep to delayExecution - delayExecution accepts the value now in seconds - should fix the linux crash svn path=/trunk/; revision=28831 --- reactos/tools/sysreg/os_support.cpp | 8 ++++---- reactos/tools/sysreg/os_support.h | 11 ++++++++++- reactos/tools/sysreg/rosboot_test.cpp | 15 +++++++++++---- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/reactos/tools/sysreg/os_support.cpp b/reactos/tools/sysreg/os_support.cpp index 7b43de42dad..5f2e7065f26 100644 --- a/reactos/tools/sysreg/os_support.cpp +++ b/reactos/tools/sysreg/os_support.cpp @@ -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 ); } diff --git a/reactos/tools/sysreg/os_support.h b/reactos/tools/sysreg/os_support.h index 85cb2c9708f..727703e4dbc 100644 --- a/reactos/tools/sysreg/os_support.h +++ b/reactos/tools/sysreg/os_support.h @@ -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: //--------------------------------------------------------------------------------------- diff --git a/reactos/tools/sysreg/rosboot_test.cpp b/reactos/tools/sysreg/rosboot_test.cpp index acec7d6e308..0f319e69a68 100644 --- a/reactos/tools/sysreg/rosboot_test.cpp +++ b/reactos/tools/sysreg/rosboot_test.cpp @@ -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)