task.waitAll
childref.Start(); var t1 = Task.Run(() => { Console.WriteLine("TaskRun启动的线程:"+Thread.CurrentThread.ManagedThreadId); }); Task.WaitAll(new Task[] { childref, t1 }); Console.WriteLine("所有线程结束后:"+ Thread.CurrentThread.ManagedThreadId);
childref.Start(); var t1 = Task.Run(() => { Console.WriteLine("TaskRun启动的线程:"+Thread.CurrentThread.ManagedThreadId); }); Task.WaitAll(new Task[] { childref, t1 }); Console.WriteLine("所有线程结束后:"+ Thread.CurrentThread.ManagedThreadId);