Blocks until the task is complete.
()
| 155 | * Blocks until the task is complete. |
| 156 | */ |
| 157 | public void waitForCompletion() throws InterruptedException { |
| 158 | synchronized (lock) { |
| 159 | if (!isCompleted()) { |
| 160 | lock.wait(); |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Creates a completed task with the given value. |