mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user