chenlulouis

暴走笑话 杭州空调维修 杭州燃气灶维修 杭州洗衣机维修 上海ktv酒吧招聘 上海招聘 上海夜场招聘 上海夜场招聘

导航

2011年2月27日 #

线程同步,线程安全例子

摘要: namespace ConsoleApplication22{ class Program { static void Main(string[] args) { Thread[] ts = new Thread[30]; TestDemo td = new TestDemo(); int i; for (i = 0; i < 30; i++) { ts[i] = new Thread(td.Test1); ts[i].Start(); } while (true) { bool flag = td.Test2(); if (flag) break; } Console.ReadKey( 阅读全文

posted @ 2011-02-27 14:02 chenlulouis 阅读(1944) 评论(0) 推荐(2) 编辑