[java] Fix locking bug in Java ThreadPool.

Fix a bug that made it possible that the tasks_lock could be locked but
never unlocked if an exception was thrown.

java/runtime/MercuryThreadPool.java:
    As above.
This commit is contained in:
Paul Bone
2014-12-13 15:27:51 +11:00
parent a17d976d86
commit 0b5e06e4ac

View File

@@ -455,6 +455,7 @@ public class MercuryThreadPool
* Have all the tasks been completed?
*/
tasks_lock.lock();
tasks_locked = true;
try {
num_tasks_submitted = this.num_tasks_submitted;
num_tasks_completed = this.num_tasks_completed;