https://kotlinlang.org logo
#coroutines
Title
# coroutines
d

Dico

07/14/2019, 11:20 AM
Yesterday I ran into a bug with
runBlocking
In my program I have a top level coroutine dispatcher that uses
runBlocking
as an event loop for the main thread. In the application code, it uses
runBlocking
somewhere else for something more trivial. It seems that the dispatcher for the 2 contexts are sharing some state. It runs a few main loop frames when the second
runBlocking
is called. Moreover, the stacktrace in intellij, which says async stack trace, doesn't indicate any difference when the main loop is executed in this way.
Has anyone else run into this?
g

gildor

07/14/2019, 2:56 PM
Maybe you could share some sample. Why do you use runBlocking for event loop?
d

Dico

07/14/2019, 3:25 PM
It's a desktop application that uses OpenGL
I will try to provide a sample
At some point
2 Views