diff --git a/rd-net/Lifetimes/Threading/SpinWaitEx.cs b/rd-net/Lifetimes/Threading/SpinWaitEx.cs index 604accf21..d0dacf5f8 100644 --- a/rd-net/Lifetimes/Threading/SpinWaitEx.cs +++ b/rd-net/Lifetimes/Threading/SpinWaitEx.cs @@ -81,12 +81,15 @@ public static bool SpinUntil(Lifetime lifetime, long timeoutMs, Func condi while (true) { - if (!lifetime.IsAlive || Environment.TickCount - start > timeoutMs) + if (!lifetime.IsAlive) return false; if (condition()) return true; + if (Environment.TickCount - start > timeoutMs) + return false; + #if !NET35 s.SpinOnce(); #else