gpt4 book ai didi

c# - C#中Thread.Join的意义是什么?

转载 作者:可可西里 更新时间:2023-11-01 08:52:16 26 4
gpt4 key购买 nike

C#中Thread.Join方法的意义是什么?

MSDN 说它会阻塞调用线程,直到线程终止。谁能用一个简单的例子解释一下?

最佳答案

Join() 基本上是 while(thread.running){}

{
thread.start()
stuff you want to do while the other thread is busy doing its own thing concurrently
thread.join()
you won't get here until thread has terminated.
}

关于c# - C#中Thread.Join的意义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2476552/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com