Last active
August 29, 2015 14:14
-
-
Save luizbon/09c514c713ac4609f3ab to your computer and use it in GitHub Desktop.
Async code with deadlock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void MyMethod(){ | |
MyMethodAsync().Result; | |
} | |
async Task MyMethodAsync(){ | |
await MyExternalResourceAsync(); //Your code will hang here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void MyMethod(){ | |
MyMethodAsync().Result; | |
} | |
async Task MyMethodAsync(){ | |
await MyExternalResourceAsync(); //Seu código vai travar aqui | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment