Deadlock on .Result from Web UI

前端 未结 1 1186
半阙折子戏
半阙折子戏 2021-01-28 08:16

I was reading the following topic http://blog.stephencleary.com/2012/07/dont-block-on-async-code.html

and decided to write a common utility method in my library to do a

相关标签:
1条回答
  • 2021-01-28 08:47

    In the general case, you should assume that yes, calling .Result or .Wait() on anything awaitable is dangerous and can deadlock (unless you are the library issuing the task, and you understand the full context). It is possible that it will work OK in some specific cases, but you should not rely on that behaviour, even if it works today.

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