System.Threading.Thread.IsBackground Property

Gets or sets a value indicating whether or not a thread is a background thread.

Syntax

public bool IsBackground { get; set; }

Value

true if the thread is or is to become a background thread; otherwise, false.

Exceptions

TypeReason
System.Threading.ThreadStateException The thread has reached the ThreadState.Stopped state.

Remarks

A thread is either a background thread or a foreground thread. Background threads are identical to foreground threads, except that background threads do not prevent a process from terminating. Once all foreground threads belonging to a process have terminated, the common language runtime ends the process. Any remaining background threads are stopped and do not complete.

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0