Move countDown() out of the loop.

This commit is contained in:
Arno Zeller 2026-06-09 16:51:21 +02:00
parent f76e5206a8
commit f6013ef227

View File

@ -53,8 +53,8 @@ public class TestDoneBeforeDoInBackground {
@Override
protected String doInBackground() throws Exception {
try {
workerStarted.countDown();
while (true) {
workerStarted.countDown();
System.out.println("Working...");
Thread.sleep(WAIT_TIME);
}