diff --git a/Libraries/Async/Async.cpp b/Libraries/Async/Async.cpp index 76481610..9a10d616 100644 --- a/Libraries/Async/Async.cpp +++ b/Libraries/Async/Async.cpp @@ -713,7 +713,10 @@ SC::Result SC::AsyncEventLoop::Internal::dispatchCompletions(SyncMode syncMode, switch (syncMode) { case SyncMode::NoWait: { - invokeExpiredTimers(loopTime); + if (kernelEvents.needsManualTimersProcessing()) + { + invokeExpiredTimers(loopTime); + } } break; case SyncMode::ForcedForwardProgress: { @@ -721,7 +724,10 @@ SC::Result SC::AsyncEventLoop::Internal::dispatchCompletions(SyncMode syncMode, { expiredTimer = nullptr; updateTime(); - invokeExpiredTimers(loopTime); + if (kernelEvents.needsManualTimersProcessing()) + { + invokeExpiredTimers(loopTime); + } } } break; diff --git a/Libraries/Async/Internal/AsyncLinux.inl b/Libraries/Async/Internal/AsyncLinux.inl index 95fae1f0..eadd35a6 100644 --- a/Libraries/Async/Internal/AsyncLinux.inl +++ b/Libraries/Async/Internal/AsyncLinux.inl @@ -63,7 +63,9 @@ struct SC::AsyncEventLoop::Internal::KernelEvents { return true; } - + + bool needsManualTimersProcessing() { return isEpoll; } + template [[nodiscard]] static Result executeOperation(T&, P& p); // clang-format on }; diff --git a/Libraries/Async/Internal/AsyncPosix.inl b/Libraries/Async/Internal/AsyncPosix.inl index 5e646fcc..48361e3b 100644 --- a/Libraries/Async/Internal/AsyncPosix.inl +++ b/Libraries/Async/Internal/AsyncPosix.inl @@ -808,6 +808,8 @@ struct SC::AsyncEventLoop::Internal::KernelEventsPosix static bool needsSubmissionWhenReactivating(AsyncFilePoll&) { return false; } + static bool needsManualTimersProcessing() { return true; } + //------------------------------------------------------------------------------------------------------- // File CLOSE //------------------------------------------------------------------------------------------------------- diff --git a/Libraries/Async/Internal/AsyncWindows.inl b/Libraries/Async/Internal/AsyncWindows.inl index 3c930656..09c6eb6e 100644 --- a/Libraries/Async/Internal/AsyncWindows.inl +++ b/Libraries/Async/Internal/AsyncWindows.inl @@ -687,10 +687,9 @@ struct SC::AsyncEventLoop::Internal::KernelEvents // If False, makes re-activation a no-op, that is a lightweight optimization. // More importantly it prevents an assert about being Submitting state when async completes during re-activation run cycle. - template static bool needsSubmissionWhenReactivating(T&) - { - return true; - } + template static bool needsSubmissionWhenReactivating(T&) { return true; } + + static bool needsManualTimersProcessing() { return true; } template [[nodiscard]] static Result executeOperation(T&, P&) { return Result::Error("Implement executeOperation"); } // clang-format on