[K/N] Fix notification order in finalizers

In before thread waiting for finalizers done could be unsuspended
before statistics about finalization is written.
Probably it doesn't affect real code, but it can lead to test failures.
This commit is contained in:
Pavel Kunyavskiy
2022-12-20 15:41:34 +01:00
committed by Space Team
parent fc95889115
commit 4f8dad3e4b
@@ -103,8 +103,8 @@ gc::ConcurrentMarkAndSweep::ConcurrentMarkAndSweep(
#endif
gcScheduler_(gcScheduler),
finalizerProcessor_(std_support::make_unique<FinalizerProcessor>([this](int64_t epoch) {
state_.finalized(epoch);
GCHandle::getByEpoch(epoch).finalizersDone();
state_.finalized(epoch);
})) {
gcScheduler_.SetScheduleGC([this]() NO_INLINE {
RuntimeLogDebug({kTagGC}, "Scheduling GC by thread %d", konan::currentThreadId());