[K/N][New MM] Fix getting current thread data in thread suspension
This commit is contained in:
@@ -22,7 +22,9 @@ bool isSuspendedOrNative(kotlin::mm::ThreadData& thread) noexcept {
|
||||
template<typename F>
|
||||
bool allThreads(F predicate) noexcept {
|
||||
auto& threadRegistry = kotlin::mm::ThreadRegistry::Instance();
|
||||
auto* currentThread = threadRegistry.CurrentThreadData();
|
||||
auto* currentThread = (threadRegistry.IsCurrentThreadRegistered())
|
||||
? threadRegistry.CurrentThreadData()
|
||||
: nullptr;
|
||||
kotlin::mm::ThreadRegistry::Iterable threads = kotlin::mm::ThreadRegistry::Instance().LockForIter();
|
||||
for (auto& thread : threads) {
|
||||
// Handle if suspension was initiated by the mutator thread.
|
||||
|
||||
Reference in New Issue
Block a user