Skip to content

Instantly share code, notes, and snippets.

@CrazyMORF
Created April 1, 2016 10:22
Show Gist options
  • Save CrazyMORF/614098fcbade81314867f0952be68e4f to your computer and use it in GitHub Desktop.
Save CrazyMORF/614098fcbade81314867f0952be68e4f to your computer and use it in GitHub Desktop.
Index action lock at line 18
using System.Threading;
using System.Threading.Tasks;
using System.Web.Mvc;
namespace WebApplication5.Controllers
{
public class HomeController : Controller
{
static async Task Work()
{
await Task.Delay(1000);//.ConfigureAwait(false);
}
public ActionResult Index()
{
var currentThread = Thread.CurrentThread; //IsBackground=false IsThreadPoolThread=false
var work = Work();
work.Wait(); //Deadlock
return View();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment