停止线程直到其他完成

Red*_*wan 1 c# multithreading

如何停止线程直到其他线程运行.我如何检查线程是否正在运行并在c#中停止线程

Jon*_*eet 7

你的问题并不完全清楚,但你可能只是追求Thread.Join:

// This will block until "otherThread" has completed
otherThread.Join();
Run Code Online (Sandbox Code Playgroud)