Created
October 29, 2010 18:34
-
-
Save anonymous/654094 to your computer and use it in GitHub Desktop.
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
Action cont1 = ...; | |
Action cont2 = ...; | |
Task.Factory.StartNew(() => | |
{ | |
if (some-synchronous-computation()) | |
return true; | |
else | |
return false; | |
}).ContinueWith(t => | |
{ | |
t.Result ? cont1() : cont2(); | |
}, TaskScheduler.FromCurrentSynchronizationContext()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment