@Test // this works in linuxX64
fun should_count_inside_a_coroutine() = asyncTest {
val tick = withContext(Dispatchers.Unconfined + Job()) {
Tick(0)
}
tick.count++
assertEquals(tick.count, 1)
}
While this fails
Copy code
@Test // this fails in linuxX64
fun should_count_inside_a_coroutine() = asyncTest {
val tick = withContext(Dispatchers.Default + Job()) {
Tick(0)
}
tick.count++
assertEquals(tick.count, 1)
}
Question is, will coroutines in
Dispatchers.Unconfied
always be resumed in the same thread when it comes to native-mt?