[K/N] Refactor suspension to reduce generated code size
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
friend void SuspendIfRequested() noexcept;
|
||||
friend void SuspendIfRequestedSlowPath() noexcept;
|
||||
|
||||
std::atomic<ThreadState> state_;
|
||||
std::atomic<bool> suspended_;
|
||||
@@ -58,6 +58,7 @@ private:
|
||||
|
||||
bool RequestThreadsSuspension() noexcept;
|
||||
void WaitForThreadsSuspension() noexcept;
|
||||
void SuspendIfRequestedSlowPath() noexcept;
|
||||
void SuspendIfRequested() noexcept;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user