SagaLib.ClientManager.checkCriticalArea C# (CSharp) Method

checkCriticalArea() public method

public checkCriticalArea ( ) : void
return void
        public void checkCriticalArea()
        {
            while (true)
            {
                if (enteredcriarea)
                {
                    TimeSpan span = DateTime.Now - timestamp;
                    if (span.TotalSeconds > 90)
                    {
                        Logger.ShowError("Deadlock detected");
                        Logger.ShowError("Automatically unlocking....");
            #if Debug
                        Logger.ShowError("Call Stack Before Entered Critical Area:");
                        foreach (StackFrame i in Stacktrace.GetFrames())
                        {
                            Logger.ShowError("at " + i.GetMethod().ReflectedType.FullName + "." + i.GetMethod().Name + " " + i.GetFileName() + ":" + i.GetFileLineNumber());
                        }
            #endif
                        LeaveCriticalArea();
                    }
                }
                Thread.Sleep(10000);
            }
        }