You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run on java9(9.0.4)
The log(msg: String) doesn't work like the description in document.
`fun log(msg: String) = println("[${Thread.currentThread().name}] $msg")`
The output is not same like expected in document:
```
[main] Unconfined
[ForkJoinPool.commonPool-worker-2] Default
[main] main runBlocking
[MyOwnThread] newSingleThreadContext
[kotlinx.coroutines.DefaultExecutor] Unconfined
```
I change to:
`fun log(msg: String) = Thread.currentThread().run { println("[$name @coroutine#$id] $msg") }`
output:
```
[main @coroutineKotlin#1] Unconfined
[ForkJoinPool.commonPool-worker-2 @coroutineKotlin#15] Default
[main @coroutineKotlin#1] main runBlocking
[MyOwnThread @coroutineKotlin#17] newSingleThreadContext
[kotlinx.coroutines.DefaultExecutor @coroutineKotlin#13] Unconfined
```
0 commit comments