如何等待线程使用.NET完成?
public void StartTheActions(){
//Starting thread 1....
Thread t1 = new Thread(new ThreadStart(action1));
t1.Start();
// Now, I want for the main thread (which is calling `StartTheActions` method)
// to wait for `t1` to finish. I've created an event in `action1` for this.
// The I wish `t2` to start...
Thread t2 = new Thread(new ThreadStart(action2));
t2.Start();}
红糖糍粑
慕村9548890
随时随地看视频慕课网APP
相关分类