[Solved] why thread isnt stopping at count 3?
When the test if (count == 3) is done the value of count is 6. And your code test it only once. You need to move the code that is out of the for loop inside it. You need also to hold a lock on t before call wait. This is done with a synchronized … Read more