[K/N][Runtime] Switch thread states in termination handlers

This commit is contained in:
Ilya Matveev
2021-07-19 20:14:14 +07:00
committed by Space
parent a1f6c70355
commit 99bd26c2ef
15 changed files with 536 additions and 126 deletions
@@ -0,0 +1,19 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
#include "testlib_api.h"
#include <stdio.h>
#include <exception>
#include <iostream>
int main(int argc, char** argv) {
// The reverse interop machinery will catch the exception on the interop border and terminate the program.
try {
testlib_symbols()->kotlin.root.setHookAndThrow();
} catch (...) {
std::cout << "Should not happen" << std::endl;
}
}