andylamax
07/22/2021, 11:09 AM@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
@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?