Fix interop_cleaners_second_thread
This commit is contained in:
committed by
Stanislav Erokhin
parent
d0cd2f2f8d
commit
cbdd6fd245
@@ -6,6 +6,8 @@
|
||||
|
||||
import kotlin.native.internal.*
|
||||
|
||||
fun ensureInitialized() {}
|
||||
|
||||
fun createCleaner() {
|
||||
createCleaner(42) {
|
||||
println(it)
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
#include <thread>
|
||||
|
||||
int main() {
|
||||
// Make sure runtime is initialized on the main thread, so that secondary thread death
|
||||
// doesn't destroy the entire runtime.
|
||||
testlib_symbols()->kotlin.root.ensureInitialized();
|
||||
std::thread t([]() { testlib_symbols()->kotlin.root.createCleaner(); });
|
||||
t.join();
|
||||
testlib_symbols()->kotlin.root.performGC();
|
||||
|
||||
Reference in New Issue
Block a user