kpgalligan
08/24/2020, 1:38 PMwithContext(Dispatchers.Default) {
log.e { "Never get's executed" }
log.e { "Never called" }
}
references log
, which is a field of BreedModel
. That will cause BreedModel
to freeze when coroutines tries to run that block on a different thread. That happens inside of coroutines “machinery”, which prior to native, didn’t really expect passing state between threads to throw exceptions. ensureNeverFrozen()
is new and coroutines hasn’t always dealt with it properly. I’ve seen some bugs submitted about it. Also, look at other output and see if you see anything about coroutines and “machinery”. Sometimes you will see that.kokeroulis
08/24/2020, 2:32 PM