public UseThread(Gate gate,string name ,string address)
		{
			this._gate = gate;
			this._myAddress = address;
			this._myName = name;

		}
Пример #2
0
		public static void Main (string[] args)
		{
			
			Console.WriteLine ("Any Key To Exit");
			var threads = new List<UseThread> ();
			var Gate = new Gate ();
			threads.Add (new UseThread (Gate, "Alice", "Alaska"));
			threads.Add (new UseThread (Gate, "Bobby", "Brazil"));
			threads.Add (new UseThread (Gate, "Chris", "Canada"));

			foreach (var thread in threads) {
				thread.Run ();
			}
			Console.ReadKey ();
			foreach (var thread in threads) {
				thread.Stop ();
			}

		}