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

Function runLoop

fdbrpc/sim2.actor.cpp:1214–1236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1212 }
1213
1214 static void runLoop(Sim2* self) {
1215 ISimulator::ProcessInfo* callingMachine = self->currentProcess;
1216 while (!self->isStopped) {
1217 self->mutex.enter();
1218 if (self->tasks.size() == 0) {
1219 self->mutex.leave();
1220 ASSERT(false);
1221 }
1222 // if (!randLog/* && now() >= 32.0*/)
1223 // randLog = fopen("randLog.txt", "wt");
1224 Task t = std::move(self->tasks.top()); // Unfortunately still a copy under gcc where .top() returns const&
1225 self->currentTaskID = t.taskID;
1226 self->tasks.pop();
1227 self->mutex.leave();
1228
1229 self->execTask(t);
1230 self->yielded = false;
1231 }
1232 self->currentProcess = callingMachine;
1233 for (auto& fn : self->stopCallbacks) {
1234 fn();
1235 }
1236 }
1237
1238 // Implement ISimulator interface
1239 void run() override { runLoop(this); }

Callers 1

runFunction · 0.85

Calls 6

moveFunction · 0.85
fnFunction · 0.85
enterMethod · 0.45
sizeMethod · 0.45
leaveMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected