Skip to content

Instantly share code, notes, and snippets.

@CrazyMORF
Created April 1, 2016 10:24
Show Gist options
  • Save CrazyMORF/32ac5b675297b6a69ee074ad094b77cb to your computer and use it in GitHub Desktop.
Save CrazyMORF/32ac5b675297b6a69ee074ad094b77cb to your computer and use it in GitHub Desktop.
There is no deadlock on Wait at line 17
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