예제 #1
0
        public void Start(BusPath path)
        {
            busPath = path;
            var t = new Task(this.Run);

            t.Start();
        }
예제 #2
0
파일: Bus.cs 프로젝트: khmelinin/Step
        internal void Start(BusPath path)
        {
            busPath    = path;
            Places     = new Semaphore(30, 30);
            StationIn  = new ManualResetEvent(false);
            StationOut = new ManualResetEvent(false);
            var t = new Task(Run);

            t.Start();
            t.Wait();
        }
예제 #3
0
        static void Main(string[] args)
        {
            var bp = new BusPath(10);
            var b  = new Bus();
            var t  = new Task(async() =>
            {
                b.Start(bp);
            });

            t.Start();
            t.Wait();
        }