is it a bug that `runBlocking(JavaFx) { runBlockin...
# coroutines
g
is it a bug that
runBlocking(JavaFx) { runBlocking(JavaFx) { }}
causes deadlock but
runBlocking(JavaFx) { runBlocking { }}
does not?
g
I would create an issue on Kotlinx.coroutines issue tracker
a
in the second example you are creating a local event loop within a single event being processed on the
JavaFx
dispatcher and blocking the
JavaFx
thread until that new event loop exits, but in the first example the inner
runBlocking(JavaFx)
says, "block the current thread I am on until the coroutine I would like to run on the JavaFx dispatcher completes", but you're already on the JavaFx dispatcher and blocking it, so the thing you're waiting for can't start.
it would kind of violate the contract of
runBlocking
if there were some magic in there to turn it into a trampoline in cases like this
u
e
File an issue if you have a use-case where you want the other one not to block.