| 135 | } |
| 136 | |
| 137 | std::optional<ScriptRunner::Outcome> ScriptRunner::takeResult(void) |
| 138 | { |
| 139 | if (mState.load() != State::Done) { |
| 140 | return std::nullopt; |
| 141 | } |
| 142 | |
| 143 | Outcome outcome; |
| 144 | { |
| 145 | std::lock_guard<std::mutex> lock(mMutex); |
| 146 | outcome = mOutcome; |
| 147 | } |
| 148 | mState.store(State::Idle); |
| 149 | return outcome; |
| 150 | } |