Does anyone know if this code would be thread safe, or do I have to use lock when calling timer2.Change?
Timer timer1 = new Timer(timerCallback1);
Timer timer2 = new Timer(timerCallback2);
timer1.Change(5000, 5000);
timer2.Change(3000, 3000);
public void timerCallback1(object state)
{
timer1.Change(Timeout.Infinite, Timeout.Infinite);
timer2.Change(Timeout.Infinite, Timeout.Infinite);
DoStuff();
timer1.Change(5000, 5000);
timer2.Change(3000, 3000);
}