Likewise, we can use the value of Thread.currentThread().name to configure a breakpoint that will only affect a given coroutine. This will be particularly useful in two scenarios: whenever you have a group of coroutines created in a loop but are interested in only one, or when you want to set the breakpoint in a piece of code that can be called from any part of the application but you are interested in a specific coroutine.
This can be easily achieved by doing a right-click in the breakpoint indicator and setting a condition based on the name of the thread:
In this case, we set the condition to Thread.currentThread().name.contains("main#2"), in the line where the year is obtained. So the breakpoint will only happen for the @main#2 coroutine.