MCPcopy Create free account
hub / github.com/Snapchat/Valdi / markUpdateCompleted

Method markUpdateCompleted

valdi/src/valdi/runtime/Context/Context.cpp:219–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219void Context::markUpdateCompleted(ContextUpdateId updateId, std::unique_lock<Mutex>& guard) {
220 std::vector<Ref<ValueFunction>> updateCompletedCallbacks;
221
222 if (!guard.owns_lock()) {
223 guard.lock();
224 }
225
226 auto it = _pendingUpdates.find(updateId);
227 if (it != _pendingUpdates.end()) {
228 _pendingUpdates.erase(it);
229 if (_pendingUpdates.empty()) {
230 std::swap(updateCompletedCallbacks, _updateCompletedCallbacks);
231 }
232 }
233
234 guard.unlock();
235
236 callUpdateCompletedCallbacks(updateCompletedCallbacks);
237}
238
239ContextUpdateId Context::lockFreeEnqueueUpdate() {
240 if (_destroyed) {

Callers 3

flushMethod · 0.80
onCreateMethod · 0.80
onViewModelUpdateMethod · 0.80

Calls 8

endMethod · 0.65
swapFunction · 0.50
lockMethod · 0.45
findMethod · 0.45
eraseMethod · 0.45
emptyMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected