Otherwise simply adding an event will make our program to live at least as long
as the created process lives.
if (background_wait_for_exit_thread != null)
return;
if (background_wait_for_exit_thread != null)
return;
- Thread t = new Thread (_ => WaitForExit ());
+ Thread t = new Thread (_ => WaitForExit ()) { IsBackground = true };
if (Interlocked.CompareExchange (ref background_wait_for_exit_thread, t, null) == null)
t.Start ();
if (Interlocked.CompareExchange (ref background_wait_for_exit_thread, t, null) == null)
t.Start ();