开发者

Does Control.Invoke pump messages?

开发者 https://www.devze.com 2023-02-01 01:43 出处:网络
Does Control.Invoke() continue to pump messages in the thread that it wa开发者_StackOverflows called from while blocked? (System.Windows.Forms) No. Invoke is blocking - the entire thread will block un

Does Control.Invoke() continue to pump messages in the thread that it wa开发者_StackOverflows called from while blocked? (System.Windows.Forms)


No. Invoke is blocking - the entire thread will block until the call to Invoke returns.

There is also BeginInvoke which is non-blocking.


No. It requires the UI thread to do the pumping. If it doesn't then Invoke() won't complete. Classic source of deadlock btw. Diagnose with Debug + Windows + Threads, check the main thread call stack.

0

精彩评论

暂无评论...
验证码 换一张
取 消