title: C++ Threading Question
body: <p>I have an object Foo which has a global variable, Time currentTime</p>
  
  <p>Foo has two methods which are called from different threads.</p>
  
  <pre><code>update()
  {
      currentTime = currentTime + timeDelay;
  }
  
  restart(Time newTime)
  {
      currentTime = newTime;
  }
  </code></pre>
  
  <p>I am seeing behavior on a restart, the time changes correctly and other times where currentTime does not seem to reset (or it does reset but then update sets it back somehow.</p>
  
  <p>The method update is called roughly every second or so while restart only occurs when a user initiates a restart event (presses a button). I think this is threading timing issue, any suggestions or comments on what is happening are welcome.</p>