CSPspEmu.Runner.Components.ComponentThread.StartSynchronized C# (CSharp) 메소드

StartSynchronized() 공개 메소드

public StartSynchronized ( ) : void
리턴 void
        public void StartSynchronized()
        {
            Console.WriteLine("Component {0} StartSynchronized!", this);
            var ElapsedTime = Logger.Measure(() =>
            {
                ComponentThreadThread = new Thread(() =>
                {
                    Thread.CurrentThread.CurrentCulture = new CultureInfo(GlobalConfig.ThreadCultureName);
                    try
                    {
                        Main();
                    }
                    finally
                    {
                        Running = false;
                        RunningUpdatedEvent.Set();
                        StopCompleteEvent.Set();
                        Console.WriteLine("Component {0} Stopped!", this);
                    }
                })
                {
                    Name = this.ThreadName,
                    IsBackground = true,
                };
                ComponentThreadThread.Start();
                ThreadTaskQueue.EnqueueAndWaitCompleted(() =>
                {
                });
            });
            //Logger.Notice("Component {0} Started! StartedTime({1})", this, ElapsedTime.TotalSeconds);
            Console.WriteLine("Component {0} Started! StartedTime({1})", this, ElapsedTime.TotalSeconds);
        }