free(cmd);
return pid;
}
- void OsSupport::sleep(long value)
+ void OsSupport::delayExecution(long value)
{
- Sleep(value);
+ Sleep(value * 1000);
}
#else
/********************************************************************************************************************/
return true;
}
- void OsSupport::sleep(long value)
+ void OsSupport::delayExecution(long value)
{
- sleep(value);
+ sleep( (clock_t)m_Delayread * CLOCKS_PER_SEC );
}
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:
//---------------------------------------------------------------------------------------
/// delay reading until emulator is ready
///
- OsSupport::sleep(m_DelayRead);
+ OsSupport::delayExecution(m_DelayRead);
}
}
//---------------------------------------------------------------------------------------
void RosBootTest::cleanup()
{
m_DataSource->closeSource();
- OsSupport::sleep(3 * CLOCKS_PER_SEC);
+ OsSupport::delayExecution(3);
if (m_Pid)
{
}
#endif
#ifndef __LINUX__
- OsSupport::sleep(500);
+ OsSupport::delayExecution(1);
#endif
assert(m_DataSource != 0);
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)