[runtime] Introduce thread states

This commit is contained in:
Ilya Matveev
2020-12-07 19:15:19 +07:00
committed by Stanislav Erokhin
parent ceae6c5a3e
commit 6fb5e43f62
8 changed files with 207 additions and 1 deletions
@@ -42,4 +42,6 @@ void EnsureDeclarationsEmitted() {
ensureUsed(FreezeSubgraph);
ensureUsed(FreezeSubgraph);
ensureUsed(CheckGlobalsAccessible);
ensureUsed(Kotlin_mm_switchThreadStateNative);
ensureUsed(Kotlin_mm_switchThreadStateRunnable);
}
@@ -268,6 +268,11 @@ void AdoptReferenceFromSharedVariable(ObjHeader* object);
void CheckGlobalsAccessible();
// Sets state of the current thread to NATIVE (used by the new MM).
ALWAYS_INLINE RUNTIME_NOTHROW void Kotlin_mm_switchThreadStateNative();
// Sets state of the current thread to RUNNABLE (used by the new MM).
ALWAYS_INLINE RUNTIME_NOTHROW void Kotlin_mm_switchThreadStateRunnable();
#ifdef __cplusplus
}
#endif