If you don't follow this rule, all bets are off with regards to something called 'spurious thread wake up' , now some people will tell you this doesn't exist or is an OS dependent thing ... however ...
in Java 1.5 (I think)?? Sun used the fact that the thread were laways allowed to spontanuosly wake up and signalled on thread death (to prevent programs such as yours lock up I think), this was reported as a bug against Java (see Sun site) but its not as its covered in the docs just previously didn't happen.
Your code is badly formed and because of that your experience some none intuitive behaviour that's harder to explain.
"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database