• Post Reply Bookmark Topic Watch Topic
  • New Topic

starting a thread twice

 
Marlene Miller
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Output:
been here
false
true
I do not understand why an IllegalThreadStateException does not occur at the second t.start().
Even so, I do not understand why the second t.isAlive() is true.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like this has been a bug in the JDK's since, well, forever. Last milennium, anyway. See 4773384 for the most up-to-date report I could find. They say it will finally be fixed in 1.5 - but I'll believe it when I see it. :roll:
 
Marlene Miller
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jim for doing the research I should have done. I forgot about the bug database.
They say the JVM treats the second start request as a no-op. It's strange isAlive becomes true.
[ June 30, 2003: Message edited by: Marlene Miller ]
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, back when I sterted Java with 1.1, about a third of my questions were best answered by checking the bug database. Fortunately nowadays that happens much less frequently; it's easy to forget to check...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!