Archive for June, 2014

Deadlocks when using Tasks

What is wrong with this code? public static class NiksMessedUpCode { private static async Task DelayAsync() { await Task.Delay(1000); } public static void Test() { // Start the delay. var delayTask = DelayAsync(); // Wait for the delay to complete. delayTask.Wait(); } }   The code compiles without errors yet there is something really terrible […]

Read More →