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

Method lock

fdbserver/VersionedBTree.actor.cpp:162–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160 }
161
162 Future<Lock> lock(int priority = 0) {
163 prioritylock_printf("lock begin %s\n", toString().c_str());
164
165 // This shortcut may enable a waiter to jump the line when the releaser loop yields
166 if (available > 0) {
167 --available;
168 Lock p;
169 addRunner(p);
170 prioritylock_printf("lock exit immediate %s\n", toString().c_str());
171 return p;
172 }
173
174 Waiter w;
175 waiters[priority].push_back(w);
176 ++waiting;
177 prioritylock_printf("lock exit queued %s\n", toString().c_str());
178 return w.lockPromise.getFuture();
179 }
180
181 std::string toString() const {
182 int runnersDone = 0;

Callers 3

writePhysicalBlockFunction · 0.45
readPhysicalBlockFunction · 0.45
readRange_implMethod · 0.45

Calls 4

toStringFunction · 0.70
c_strMethod · 0.45
push_backMethod · 0.45
getFutureMethod · 0.45

Tested by

no test coverage detected