MCPcopy Create free account
hub / github.com/apple/foundationdb / execTask

Function execTask

fdbrpc/sim2.actor.cpp:2234–2263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 11

printfFunction · 0.85
TraceEventClass · 0.85
deterministicRandomFunction · 0.85
VoidClass · 0.70
killProcessFunction · 0.70
NeverClass · 0.50
printFunction · 0.50
sendMethod · 0.45
enterMethod · 0.45
leaveMethod · 0.45
peekMethod · 0.45

Tested by

no test coverage detected