日期:2014-05-18 浏览次数:20772 次
static int a = 1; static void Main(string[] argv) { ThreadPool.QueueUserWorkItem(p => { while (true) { Console.WriteLine(a); Thread.Sleep(500); } }); Proc(out a); } private static void Proc(out int a) { var ram = new Random(); while (true) { Thread.Sleep(200); a = ram.Next(1000); } }