public void PauseSynchronized()
        {
            Logger.Notice("Component {0} PauseSynchronized!", this);

            //Console.WriteLine("[1]");

            ThreadTaskQueue.EnqueueAndWaitStarted(() =>
            {
                //int MaxCounts = 200;
                //Console.WriteLine("[2]");
                while (!PauseEvent.WaitOne(10.Milliseconds()))
                {
                    //Console.WriteLine("[3]");
                    if (!Running)
                    {
                        break;
                    }
                    //if (MaxCounts-- < 0)
                    //{
                    //	Console.Error.WriteLine("Infinite loop detected!");
                    //	break;
                    //}
                }
            }, TimeSpan.FromSeconds(2), () => { Console.WriteLine("Timed Out!"); });
        }
Exemple #2
0
        public void PauseSynchronized()
        {
            Console.WriteLine("Component {0} PauseSynchronized!", this);

            ThreadTaskQueue.EnqueueAndWaitStarted(() =>
            {
                while (!PauseEvent.WaitOne(TimeSpan.FromMilliseconds(10)))
                {
                    if (!Running)
                    {
                        break;
                    }
                }
            });
        }