The IsBackground Property


As mentioned earlier, the .NET Framework defines two types of threads: foreground and background. The only difference between the two is that a process won’t end until all of its foreground threads have ended, but background threads are terminated automatically after all foreground threads have stopped. By default, a thread is created as a foreground thread. It can be changed to a background thread by using the IsBackground property defined by Thread, as shown here:

 public bool IsBackground { get; set; }

To set a thread to background, simply assign IsBackground a true value. A value of false indicates a foreground thread.




C# 2.0(c) The Complete Reference
C# 2.0: The Complete Reference (Complete Reference Series)
ISBN: 0072262095
EAN: 2147483647
Year: 2006
Pages: 300

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net