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
For System.Threading.Thread : 4.0.0-beta-23516, there appears to be a problem having the thread execute as a foreground thread on DNX (1.0.0-beta6-12120). The property IsBackground does not appear to have any bearing on how this thread is treated, with it seemingly behaving like a background thread with IsBackground reporting false. The end result is the caller must explicitly join on the thread to prevent a process exiting, which is not typical behavior.
I am mindful that this may be related to DNX, or potentially functionality under review for corefx with consideration to varying platforms.
Below, the expected behavior would be to have the process stay running until this thread exits.
using System;namespaceexample{publicclassProgram{publicstaticvoidMain(string[]args){// 4.0.0-beta-23516vart=new System.Threading.Thread(()=>{varrunning=true;while(running){// we do not want this thread to exit.}});
t..Start();// t.Join(); // this shouldn't be necessary for IsBackground = false}}}
Many Thanks
The text was updated successfully, but these errors were encountered:
Hi there,
For
System.Threading.Thread : 4.0.0-beta-23516
, there appears to be a problem having the thread execute as a foreground thread on DNX (1.0.0-beta6-12120
). The propertyIsBackground
does not appear to have any bearing on how this thread is treated, with it seemingly behaving like a background thread withIsBackground
reporting false. The end result is the caller must explicitly join on the thread to prevent a process exiting, which is not typical behavior.I am mindful that this may be related to DNX, or potentially functionality under review for corefx with consideration to varying platforms.
MSDN: CLR Thread.IsBackground Property
https://msdn.microsoft.com/en-us/library/system.threading.thread.isbackground%28v=vs.110%29.aspx
Below, the expected behavior would be to have the process stay running until this thread exits.
Many Thanks
The text was updated successfully, but these errors were encountered: