Julien Lebosquain
3 years ago
No known key found for this signature in database
GPG Key ID: 1833CAD10ACC46FD
1 changed files with
9 additions and
3 deletions
-
src/Avalonia.Controls/Platform/ManagedDispatcherImpl.cs
|
|
@ -99,9 +99,15 @@ public class ManagedDispatcherImpl : IControlledDispatcherImpl |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (_nextTimer != null) |
|
|
TimeSpan? nextTimer; |
|
|
|
|
|
lock (_lock) |
|
|
|
|
|
{ |
|
|
|
|
|
nextTimer = _nextTimer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (nextTimer != null) |
|
|
{ |
|
|
{ |
|
|
var waitFor = _clock.Elapsed - _nextTimer.Value; |
|
|
var waitFor = nextTimer.Value - _clock.Elapsed; |
|
|
if (waitFor.TotalMilliseconds < 1) |
|
|
if (waitFor.TotalMilliseconds < 1) |
|
|
continue; |
|
|
continue; |
|
|
_wakeup.WaitOne(waitFor); |
|
|
_wakeup.WaitOne(waitFor); |
|
|
@ -112,4 +118,4 @@ public class ManagedDispatcherImpl : IControlledDispatcherImpl |
|
|
|
|
|
|
|
|
registration.Dispose(); |
|
|
registration.Dispose(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|