示例#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();
        }