Created
April 1, 2016 10:24
-
-
Save CrazyMORF/32ac5b675297b6a69ee074ad094b77cb to your computer and use it in GitHub Desktop.
There is no deadlock on Wait at line 17
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
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication7 | |
{ | |
class Program | |
{ | |
static async Task Work() | |
{ | |
await Task.Delay(1000); | |
} | |
static void Main(string[] args) | |
{ | |
var currentThread = Thread.CurrentThread; //IsBackground=false IsThreadPoolThread=false | |
var work = Work(); | |
work.Wait(); //no Deadlock here | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment