diff --git a/kotlin-native/runtime/src/mm/cpp/ThreadSuspension.cpp b/kotlin-native/runtime/src/mm/cpp/ThreadSuspension.cpp index ac1f1e3f923..67728f5798f 100644 --- a/kotlin-native/runtime/src/mm/cpp/ThreadSuspension.cpp +++ b/kotlin-native/runtime/src/mm/cpp/ThreadSuspension.cpp @@ -86,9 +86,13 @@ void kotlin::mm::WaitForThreadsSuspension() noexcept { } } +NO_INLINE void kotlin::mm::SuspendIfRequestedSlowPath() noexcept { + mm::ThreadRegistry::Instance().CurrentThreadData()->suspensionData().suspendIfRequestedSlowPath(); +} + ALWAYS_INLINE void kotlin::mm::SuspendIfRequested() noexcept { if (IsThreadSuspensionRequested()) { - mm::ThreadRegistry::Instance().CurrentThreadData()->suspensionData().suspendIfRequestedSlowPath(); + SuspendIfRequestedSlowPath(); } } diff --git a/kotlin-native/runtime/src/mm/cpp/ThreadSuspension.hpp b/kotlin-native/runtime/src/mm/cpp/ThreadSuspension.hpp index 11364abf86d..77804fce962 100644 --- a/kotlin-native/runtime/src/mm/cpp/ThreadSuspension.hpp +++ b/kotlin-native/runtime/src/mm/cpp/ThreadSuspension.hpp @@ -49,7 +49,7 @@ public: } private: - friend void SuspendIfRequested() noexcept; + friend void SuspendIfRequestedSlowPath() noexcept; std::atomic state_; std::atomic suspended_; @@ -58,6 +58,7 @@ private: bool RequestThreadsSuspension() noexcept; void WaitForThreadsSuspension() noexcept; +void SuspendIfRequestedSlowPath() noexcept; void SuspendIfRequested() noexcept; /**