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

Method addThread

fdbserver/coroimpl/CoroFlow.actor.cpp:222–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220
221 Future<Void> getError() const override { return pool->anyError.getResult(); }
222 void addThread(IThreadPoolReceiver* userData, const char*) override {
223 checkError();
224
225 auto w = new Worker(pool.getPtr(), userData);
226 pool->queueLock.enter();
227 pool->workers.push_back(w);
228 pool->queueLock.leave();
229 pool->anyError.add(w->error.getFuture());
230 pool->allStopped.add(w->stopped.getFuture());
231 startWorker(w);
232 }
233 ACTOR static void startWorker(Worker* w) {
234 // We want to make sure that coroutines are always started after Net2::run() is called, so the main coroutine is
235 // initialized.

Callers 6

LineNoiseMethod · 0.45
KeyValueStoreSQLiteMethod · 0.45
startReadThreadsMethod · 0.45
RocksDBKeyValueStoreMethod · 0.45

Calls 7

checkErrorFunction · 0.85
getPtrMethod · 0.45
enterMethod · 0.45
push_backMethod · 0.45
leaveMethod · 0.45
addMethod · 0.45
getFutureMethod · 0.45

Tested by

no test coverage detected