.net多线程 Thread

1.Thread.start();

1 new Thread(() => this.DoSomethingLong("btnThreads_Click")).Start();

 2.线程等待

1 //线程等待
2             thread.Join(500);//最多等500
3             Console.WriteLine("等待500ms");
4             thread.Join();//当前线程等待thread完成
5 
6             while (thread.ThreadState != ThreadState.Stopped)
7             {
8                 Thread.Sleep(100);//当前线程 休息100ms  
9             }

3.

posted on 2019-05-30 22:04  雯烈  阅读(189)  评论(0编辑  收藏  举报