Obtiene el subproceso actualmente en ejecución.
Espacio de nombres: System.Threading
Ensamblado: mscorlib (en mscorlib.dll)
Visual Basic (Declaración)
Public Shared ReadOnly Property CurrentThread As Thread
Dim value As Thread
value = Thread.CurrentThread
public static Thread CurrentThread { get; }
public:
static property Thread^ CurrentThread {
Thread^ get ();
}
/** @property */
public static Thread get_CurrentThread ()
public static function get CurrentThread () : Thread
Valor de propiedad
Thread que representa el subproceso actualmente en ejecución.
Este ejemplo de código forma parte de un ejemplo más extenso referente a la propiedad IsThreadPoolThread.
Shared Sub ThreadMethod()
Console.WriteLine("ThreadOne, executing ThreadMethod, " & _
"is from the thread pool? {0}", _
Thread.CurrentThread.IsThreadPoolThread)
End Sub
static void ThreadMethod()
{
Console.WriteLine("ThreadOne, executing ThreadMethod, " +
"is {0}from the thread pool.",
Thread.CurrentThread.IsThreadPoolThread ? "" : "not ");
}
static void ThreadMethod()
{
Console::WriteLine( "ThreadOne, executing ThreadMethod, "
"is {0}from the thread pool.", Thread::CurrentThread->IsThreadPoolThread ? (String^)"" : "not " );
}
Windows 98, Windows 2000 Service Pack 4, Windows CE, Windows Millennium, Windows Mobile para Pocket PC, Windows Mobile para Smartphone, Windows Server 2003, Windows XP Media Center, Windows XP Professional x64, Windows XP SP2, Windows XP Starter
Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.
.NET Framework
Compatible con: 3.0, 2.0, 1.1, 1.0
.NET Compact Framework
Compatible con: 2.0, 1.0
XNA Framework
Compatible con: 1.0