You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System;using System.Threading;namespaceConsoleApplication1{internalclassProgram{publicstaticvoidMain(){vart=new Thread(()=>{while(true);});
t.IsBackground =false;
t.Start();
Console.WriteLine("finished");}}}
When ran with DNX, this has different behavior on CoreCLR and CLR. On CLR this waits forever, while on CoreCLR, it prints "finished" and exits immediately.
If there was a way to make hosting CoreCLR apps (which needed by DNX) behave the same on shutdown as Desktop CLR apps, we could make these behave the same.
The text was updated successfully, but these errors were encountered:
It looks like the mechanism is present even for CoreCLR, but never kicks in. The Assembly::ExecuteMainMethod calls RunMainPost method that is responsible for waiting for the other threads, but it calls it conditionally based on the stringArgs parameter being NULL or not being NULL.
On CoreCLR, the stringArgs is never NULL and so the wait is never executed.
It seems that adding a bool parameter to the ExecuteMainMethod that would indicate whether to wait or not instead of deriving it from the value of the stringArgs should fix the problem.
From aspnet/dnx#1589
When ran with DNX, this has different behavior on CoreCLR and CLR. On CLR this waits forever, while on CoreCLR, it prints "finished" and exits immediately.
If there was a way to make hosting CoreCLR apps (which needed by DNX) behave the same on shutdown as Desktop CLR apps, we could make these behave the same.
The text was updated successfully, but these errors were encountered: