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.*
|
import kotlin.native.internal.*
|
||||||
|
|
||||||
|
fun ensureInitialized() {}
|
||||||
|
|
||||||
fun createCleaner() {
|
fun createCleaner() {
|
||||||
createCleaner(42) {
|
createCleaner(42) {
|
||||||
println(it)
|
println(it)
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
int main() {
|
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(); });
|
std::thread t([]() { testlib_symbols()->kotlin.root.createCleaner(); });
|
||||||
t.join();
|
t.join();
|
||||||
testlib_symbols()->kotlin.root.performGC();
|
testlib_symbols()->kotlin.root.performGC();
|
||||||
|
|||||||
Reference in New Issue
Block a user