( ) . , , , ..
update()
{
// Lock mutex
currentTime = currentTime + timeDelay;
// unlock mutex
}
// Same idea for restart()
, syncronization, , . , update() currentTime, , , , restart() . update(), ( ) currentTime, (). Mutex , , . Google - , .
/ , /, . - pthreads * nix, Win32. ( pthreads Win32). Boost .