[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 {
|
ALWAYS_INLINE void kotlin::mm::SuspendIfRequested() noexcept {
|
||||||
if (IsThreadSuspensionRequested()) {
|
if (IsThreadSuspensionRequested()) {
|
||||||
mm::ThreadRegistry::Instance().CurrentThreadData()->suspensionData().suspendIfRequestedSlowPath();
|
SuspendIfRequestedSlowPath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend void SuspendIfRequested() noexcept;
|
friend void SuspendIfRequestedSlowPath() noexcept;
|
||||||
|
|
||||||
std::atomic<ThreadState> state_;
|
std::atomic<ThreadState> state_;
|
||||||
std::atomic<bool> suspended_;
|
std::atomic<bool> suspended_;
|
||||||
@@ -58,6 +58,7 @@ private:
|
|||||||
|
|
||||||
bool RequestThreadsSuspension() noexcept;
|
bool RequestThreadsSuspension() noexcept;
|
||||||
void WaitForThreadsSuspension() noexcept;
|
void WaitForThreadsSuspension() noexcept;
|
||||||
|
void SuspendIfRequestedSlowPath() noexcept;
|
||||||
void SuspendIfRequested() noexcept;
|
void SuspendIfRequested() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user