Thread.Join和waitHandle.WaitOne(),它们都强制调用线程等待。直到线程完成执行为止,直到分别调用waitHandle.Set()为止。
但是除此之外,这2之间有什么区别吗?
最佳答案
...both of them force the calling thread to wait until the called thread has finished executing.
不,他们没有。他们是完全不同的。
WaitHandle.WaitOne将阻塞调用线程,直到发出等待句柄为止。
Thread.Join将阻塞调用线程,直到调用
Join
方法的线程对象执行完毕(终止)
关于c# - Thread.Join和waitHandle.WaitOne()有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30000404/