SpinWait.SpinOnce Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
SpinOnce() |
Performs a single spin. |
SpinOnce(Int32) |
Performs a single spin and calls Sleep(Int32) after a minimum spin count. |
SpinOnce()
- Source:
- SpinWait.cs
- Source:
- SpinWait.cs
- Source:
- SpinWait.cs
Performs a single spin.
public:
void SpinOnce();
public void SpinOnce ();
member this.SpinOnce : unit -> unit
Public Sub SpinOnce ()
Remarks
This method is typically called in a loop and may change in behavior based on the number of times SpinOnce has been called so far on this instance. Each spin results in the SpinWait method being called. A count is kept of the number of times SpinOnce is called, and after a threshold count is reached, the Yield method is called.
See also
Applies to
SpinOnce(Int32)
- Source:
- SpinWait.cs
- Source:
- SpinWait.cs
- Source:
- SpinWait.cs
Performs a single spin and calls Sleep(Int32) after a minimum spin count.
public:
void SpinOnce(int sleep1Threshold);
public void SpinOnce (int sleep1Threshold);
member this.SpinOnce : int -> unit
Public Sub SpinOnce (sleep1Threshold As Integer)
Parameters
- sleep1Threshold
- Int32
A minimum spin count after which Thread.Sleep(1)
may be used. A value of -1 disables the use of Thread.Sleep(1)
.
Exceptions
sleep1Threshold
is less than -1.
Remarks
This method is typically called in a loop and may change in behavior based on the number of times SpinOnce() has been called so far on this instance.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기