mscorlib 4.0.0.0 System.ValueType

encapsulates common spinning logic. On single-processor machines, yields are always used instead of busy waits, and on computers with Intel processors employing Hyper-Threading technology, it helps to prevent hardware thread starvation. SpinWait encapsulates a good mixture of spinning and true yielding.

is a value type, which means that low-level code can utilize SpinWait without fear of unnecessary allocation overheads. SpinWait is not generally useful for ordinary applications. In most cases, you should use the synchronization classes provided by the .NET Framework, such as . For most purposes where spin waiting is required, however, the type should be preferred over the method.

Provides support for spin-based waiting.

- Property
  4.0.0.0
  System.Int32 To be added. To be added.

  Gets the number of times has been called on this instance.

- Property
  4.0.0.0
  System.Boolean To be added.

  On a single-CPU machine, always yields the processor. On machines with multiple CPUs, may yield after an unspecified number of calls.

  Gets whether the next call to will yield the processor, triggering a forced context switch.

- Method
  4.0.0.0
  System.Void

  This makes and behave as though no calls to had been issued on this instance. If a instance is reused many times, it may be useful to reset it to avoid yielding too soon.

  Resets the spin counter.

- Method
  4.0.0.0
  System.Void

  This is typically called in a loop, and may change in behavior based on the number of times a has been called thus far on this instance. Each spin results in the method being called. A count is kept of the number of times is called, and after a threshold count is reached, the method is called.

  Performs a single spin.

- Method
  4.0.0.0
  System.Void `` To be added.

  Spins until the specified condition is satisfied.

  A delegate to be executed over and over until it returns true.
- Method
  4.0.0.0
  System.Boolean `` `` To be added.

  Spins until the specified condition is satisfied or until the specified timeout is expired.

  True if the condition is satisfied within the timeout; otherwise, false

  A delegate to be executed over and over until it returns true. The number of milliseconds to wait, or (-1) to wait indefinitely.
- Method
  4.0.0.0
  System.Boolean `` `` To be added.

  Spins until the specified condition is satisfied or until the specified timeout is expired.

  True if the condition is satisfied within the timeout; otherwise, false

  A delegate to be executed over and over until it returns true. A that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.