我有一个包含以下内容的函数
WebUpdateThread = New System.Threading.Thread(AddressOf generatecids)
WebUpdateThread.SetApartmentState(ApartmentState.STA)
WebUpdateThread.Start()
'after starting the thread i have some code that i want to run when the thread finshes its work which takes about 3-4 hours
'if i put for example
MsgBox("something")
消息框在线程启动后立即显示,我如何让它等到线程完成?
有没有比检查线程状态的无限while循环更充分的东西?