void LoaderThread() { Profiler.SetThread(); Game.SetThreadLanguage(); while (true) { // Wait for a new Update() command State.WaitTillStarted(); if (State.Terminated) { break; } try { if (!DoLoad()) { return; } } finally { // Signal finished so RenderProcess can start drawing State.SignalFinish(); } } }