1
0
Fork 0

following the comment on the pull requests:

- Added #NUM_OF_THREADS complete job in the queue at the end of  the main loop to avoid deadlock
This commit is contained in:
Sandro La Bruzzo 2024-02-28 09:10:55 +01:00
parent a712df1e1d
commit 915a76a796
2 changed files with 4 additions and 3 deletions

View File

@ -135,7 +135,6 @@ public class ORCIDWorker extends Thread {
orcidId = queue.take();
if (orcidId.equalsIgnoreCase(JOB_COMPLETE)) {
queue.put(orcidId);
hasComplete = true;
} else {
start = System.currentTimeMillis();

View File

@ -155,15 +155,17 @@ public class OrcidGetUpdatesFile {
throw new RuntimeException(e);
}
});
}
}
for (int i = 0; i < 22; i++) {
queue.put(ORCIDWorker.JOB_COMPLETE);
}
}
for (ORCIDWorker worker : workers) {
worker.join();
}
}
}