- rename sleep to delayExecution

- delayExecution accepts the value now in seconds
- should fix the linux crash

svn path=/trunk/; revision=28831
This commit is contained in:
Johannes Anderwald 2007-09-04 09:36:00 +00:00
parent 0c92f06002
commit 9b5863ddfb
3 changed files with 25 additions and 9 deletions

View 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 );
}

View 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:
//---------------------------------------------------------------------------------------

View 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)