1
爲什麼下面的代碼始終在obj
中返回False
。我已確保SomeBoolReturningFunc
正在返回True
。從ThreadPool返回值線程
Dim obj As Object = False
ThreadPool.QueueUserWorkItem(Sub(state)
state = SomeBoolReturningFunc()
End Sub,
obj)
'Keep waiting till queued thread completes
Return obj
謝謝你一堆。這正是我最終的結果。這也提出了另一個問題,我發佈在http://stackoverflow.com/questions/15064027/is-there-a-built-in-generic-class-for-this-in-net。請看一看。 – dotNET 2013-02-25 09:46:58