public void RecalcGameState(object o) { // TODO: Сделать блокировку доступа к полю LastUpdate if ((DateTime.Now - lastUpdate).TotalSeconds < MinimalRecalcPeriod) { return; } if (doers > 0) { LogManager.GetLogger("LogToFile").Warn(String.Format( "Ахтунг!!! Doers = {0}", doers)); return; } // TODO: Сделать блокировку доступа к полю Doers try { doers++; SetDummyHttpContext(); recalcGameStateService.RecalcGameState(DateTime.Now); } catch (Exception e) { LogManager.GetLogger("LogToFile").Warn(String.Format( "Ахтунг ошибка!!! Doers = {0}, {1}", doers, e)); } finally { doers--; lastUpdate = DateTime.Now; } }