Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Could static thread be stopped in Kestrel on Linux without manual abort?

$
0
0
public class HomeController {

public static Thread Thread = new Thread(new ThreadStart(Work));

public ViewResult Index()
{
if(!Thread.IsAlive && DateTime.Now < new DateTime(2020,12,31))
    Thread.Start()

return View();

}

public static void Work()
{
}

}

What reasons could lead to Thread abort in this piece of code rather than manual server machine stop on Linux if we call Index only once a year?


Viewing all articles
Browse latest Browse all 9386

Trending Articles