SpinWait.SpinUntil Method
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.
Spins until the specified condition is satisfied.
SpinUntil(Func<Boolean>) |
Spins until the specified condition is satisfied. |
SpinUntil(Func<Boolean>, Int32) |
Spins until the specified condition is satisfied or until the specified timeout is expired. |
SpinUntil(Func<Boolean>, TimeSpan) |
Spins until the specified condition is satisfied or until the specified timeout is expired. |
- Source:
- SpinWait.cs
- Source:
- SpinWait.cs
- Source:
- SpinWait.cs
Spins until the specified condition is satisfied.
public:
static void SpinUntil(Func<bool> ^ condition);
public static void SpinUntil (Func<bool> condition);
static member SpinUntil : Func<bool> -> unit
Public Shared Sub SpinUntil (condition As Func(Of Boolean))
Parameters
Exceptions
The condition
argument is null.
See also
Applies to
.NET 9 och andra versioner
Produkt | Versioner |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- SpinWait.cs
- Source:
- SpinWait.cs
- Source:
- SpinWait.cs
Spins until the specified condition is satisfied or until the specified timeout is expired.
public:
static bool SpinUntil(Func<bool> ^ condition, int millisecondsTimeout);
public static bool SpinUntil (Func<bool> condition, int millisecondsTimeout);
static member SpinUntil : Func<bool> * int -> bool
Public Shared Function SpinUntil (condition As Func(Of Boolean), millisecondsTimeout As Integer) As Boolean
Parameters
- millisecondsTimeout
- Int32
The number of milliseconds to wait, or Infinite (-1) to wait indefinitely.
Returns
true
if the condition is satisfied within the timeout; otherwise, false.
Exceptions
The condition
argument is null.
millisecondsTimeout
is a negative number other than -1, which represents an infinite time-out.
See also
Applies to
.NET 9 och andra versioner
Produkt | Versioner |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- SpinWait.cs
- Source:
- SpinWait.cs
- Source:
- SpinWait.cs
Spins until the specified condition is satisfied or until the specified timeout is expired.
public:
static bool SpinUntil(Func<bool> ^ condition, TimeSpan timeout);
public static bool SpinUntil (Func<bool> condition, TimeSpan timeout);
static member SpinUntil : Func<bool> * TimeSpan -> bool
Public Shared Function SpinUntil (condition As Func(Of Boolean), timeout As TimeSpan) As Boolean
Parameters
- timeout
- TimeSpan
A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.
Returns
true
if the condition is satisfied within the timeout; otherwise, false.
Exceptions
The condition
argument is null.
timeout
is a negative number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than Int32.MaxValue.
See also
Applies to
.NET 9 och andra versioner
Produkt | Versioner |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Feedback om .NET
.NET är ett öppen källkod projekt. Välj en länk för att ge feedback: