| 88 | } |
| 89 | |
| 90 | void checked() |
| 91 | { |
| 92 | // The future 'checking' can only be discarded in 'finalize'. |
| 93 | CHECK(!checking.isDiscarded()); |
| 94 | |
| 95 | if (checking.isFailed()) { |
| 96 | promise.fail("Failed to get missing positions: " + checking.failure()); |
| 97 | terminate(self()); |
| 98 | } else if (!checking.get()) { |
| 99 | // The position has been learned. |
| 100 | promise.set(proposal); |
| 101 | terminate(self()); |
| 102 | } else { |
| 103 | // Still missing, try to fill it. |
| 104 | fill(); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | void fill() |
| 109 | { |