none of the running threads have an ID of 0
# announcements
a
none of the running threads have an ID of 0
s
What about the main thread that runs
main
? That one probably has id=0
a
@streetsofboston shouldn't that be on the same thread as
test1()
though?
s
If your
main
calls
test1()
, yes.
a
Copy code
fun main() {
    test1()
}
s
Mmmmm… that odd..
n
"Thread-0" is the thread name, which is not necessarily the same as the thread ID.
Copy code
thread { 
  println(Thread.currentThread().id)
  println(Thread.currentThread().name)
 }
Running in the REPL gives
Copy code
21
Thread-8
👍 2
a
thanks @Nick Aiello
d
thread
will use a default
ThreadFactory
which created it with that name