Is Delegate.EndInvoke() really necessary?

前端 未结 7 1949
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 08:28

I\'ve read a couple of forums and even a stackoverflow question or two saying that Delegate.EndInvoke is necessary when using Delegate.BeginInvoke. Many of the articles I\'

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 08:49

    From the Windows Form documentation on Control.BeginInvoke()

    You can call EndInvoke to retrieve the return value from the delegate, if neccesary, but this is not required. EndInvoke will block until the return value can be retrieved.

    This is the particular case of Windows Form async call on the UI thread and this this doesn't apply to the general case, yet this can help for those in this situation.

提交回复
热议问题