Skip to main content
11 events
when toggle format what by license comment
Mar 24, 2018 at 13:37 history edited Peter Mortensen CC BY-SA 3.0
Active reading. [<http://stackoverflow.com/legal/trademark-guidance> (the last section)].
Mar 23, 2018 at 22:24 comment added Hans Passant I seriously doubt the warranty and money-back guarantee you want is available here.
Mar 23, 2018 at 22:18 comment added Stephen @HansPassant the contradiction is between the highly voted answer "A thread is alive if it has been started and has not yet died" and the comment "isAlive returns false if the thread hasn't started executing yet (even if your own thread has already called start on it)". Nobody is talking about calling isAlive on a thread that we haven't started.
Mar 23, 2018 at 22:14 comment added Hans Passant It is just not contradictory. The highly voted answer includes the clause "if it has been started". Try it. And think for a bit if it is useful at all to check if it alive if you didn't start it yet.
Mar 23, 2018 at 22:05 comment added Martin James ..and could return true after the thread method exits.
Mar 23, 2018 at 22:02 comment added Stephen @MikeMcCaughan I thought the same thing, but if the issue is that isAlive() could return false for like a millisecond before the thread starts, it could be hard to verify.
Mar 23, 2018 at 22:00 comment added Stephen @MartinJames why do you say that? It seems like polling on isAlive() would be the best way to wait for a thread to finish while simultaneously doing other things. Anyway I had a question about how best to accomplish that which I posted here (stackoverflow.com/questions/49458824/…) and I ended up just asking about the contradiction in my preface.
Mar 23, 2018 at 21:51 comment added Heretic Monkey This seems like one of those questions that is most easily answered by trying it. You know, in code? But I don't know from Java.
Mar 23, 2018 at 21:38 answer added Servy timeline score: 4
Mar 23, 2018 at 21:38 comment added Martin James In this particular case, the correct advice would be 'don't use isAlive at all - if you think you need it, you're doing something wrong'
Mar 23, 2018 at 21:34 history asked Stephen CC BY-SA 3.0