private void DoWrite(object state)
{
try
{
int? counter = state as int?;
lock (m_variables)
{
if (counter == null || counter != m_writeTimerCounter)
{
return;
}
if (m_stopped != 0)
{
return;
}
}
bool success = Write(counter.Value);
if (!success)
{
HaltTestOnError(null, "Error occurred while writing values.", null);
return;
}
}
catch (Exception e)
{
HaltTestOnError(e, "Fatal error while writing values.", null);
}
}