control.BeginInvoke() fails to call the delegate

前端 未结 1 1833
名媛妹妹
名媛妹妹 2021-01-15 08:09

I noticed that control.BeginInvoke(delegate) some times fail to call the delegate. I understand that BeginInvoke just creates a PostMessage and that message is handled by th

相关标签:
1条回答
  • 2021-01-15 08:32

    The code looks fine to me as posted. If this does not match your code in use then I would suggest looking for one of the following:

    1) If your consuming task takes longer then the FiveSeconds method to give the appearance of not being called every time

    2) If the combination of the consuming task and Updating the UI results in the appearance of the method not being called every time

    3) If any of the code not shown in the consuming task could alter the value of executing (or exit the method because it can be set to false)

    0 讨论(0)
提交回复
热议问题