| 2232 | }; |
| 2233 | |
| 2234 | void execTask(struct Task& t) { |
| 2235 | if (t.machine->failed) { |
| 2236 | t.action.send(Never()); |
| 2237 | } else { |
| 2238 | mutex.enter(); |
| 2239 | if (printSimTime && (int)this->time < (int)t.time) { |
| 2240 | printf("Time: %d\n", (int)t.time); |
| 2241 | } |
| 2242 | this->time = t.time; |
| 2243 | this->timerTime = std::max(this->timerTime, this->time); |
| 2244 | mutex.leave(); |
| 2245 | |
| 2246 | this->currentProcess = t.machine; |
| 2247 | try { |
| 2248 | t.action.send(Void()); |
| 2249 | ASSERT(this->currentProcess == t.machine); |
| 2250 | } catch (Error& e) { |
| 2251 | TraceEvent(SevError, "UnhandledSimulationEventError").errorUnsuppressed(e); |
| 2252 | killProcess(t.machine, KillInstantly); |
| 2253 | } |
| 2254 | |
| 2255 | if (randLog) |
| 2256 | fmt::print(randLog, |
| 2257 | "T {0} {1} {2} {3}\n", |
| 2258 | this->time, |
| 2259 | int(deterministicRandom()->peek() % 10000), |
| 2260 | t.machine ? t.machine->name : "none", |
| 2261 | t.stable); |
| 2262 | } |
| 2263 | } |
| 2264 | |
| 2265 | void onMainThread(Promise<Void>&& signal, TaskPriority taskID) override { |
| 2266 | // This is presumably coming from either a "fake" thread pool thread, i.e. it is actually on this thread |
nothing calls this directly
no test coverage detected