Thread.SpinWait Method

Causes a thread to wait the number of times defined by the iterations parameter.

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)

public static void SpinWait (
	int iterations
public static void SpinWait (
	int iterations
public static function SpinWait (
	iterations : int



A 32-bit signed integer that defines how long a thread is to wait.


The HostProtectionAttribute attribute applied to this method has the following Resources property value: Synchronization | ExternalThreading. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions