Skip to content

Instantly share code, notes, and snippets.

@luizbon
Last active August 29, 2015 14:14
Show Gist options
  • Save luizbon/09c514c713ac4609f3ab to your computer and use it in GitHub Desktop.
Save luizbon/09c514c713ac4609f3ab to your computer and use it in GitHub Desktop.
Async code with deadlock
void MyMethod(){
MyMethodAsync().Result;
}
async Task MyMethodAsync(){
await MyExternalResourceAsync(); //Your code will hang here
}
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