July 2018
Intermediate to advanced
266 pages
7h 11m
English
Because the debug flag affects the value of the name of the thread, you can add a watch in the IDE—to do so, press the New Watch button in the Variables section of the Debug Tool window. Once the execution is stopped at a breakpoint inside a coroutine, and if you have a watch for the name of the thread there, you will be able to see which coroutine is the one that is currently being executed:

This example uses a watch variable set to Thread.currentThread().name and a breakpoint where the year is printed. We can see that in my case it was the second inner coroutine that was stopped.
Read now
Unlock full access