HostProtectionAttribute.ExternalThreading Property
.NET Framework 4.5
Gets or sets a value indicating whether external threading is exposed.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System.Booleantrue if external threading is exposed; otherwise, false. The default is false.
The following code example illustrates the use of the HostProtectionAttribute attribute with the ExternalThreading property. This example is part of a larger example provided for the HostProtectionAttribute class.
// Use the enumeration flags to indicate that this method exposes // synchronization and external threading. [HostProtectionAttribute(Synchronization=true, ExternalThreading=true)] private static void StartThread() { Thread t = new Thread(new ThreadStart(WatchFileEvents)); // Start the new thread. On a uniprocessor, the thread is not given // any processor time until the main thread yields the processor. t.Start(); // Give the new thread a chance to execute. Thread.Sleep(1000); }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.