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

Method set

flow/include/flow/ThreadHelper.actor.h:840–854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838 }
839
840 void set(V const& v, bool triggerIfSame = false) {
841 Reference<ThreadSingleAssignmentVar<Void>> trigger(new ThreadSingleAssignmentVar<Void>());
842
843 lock.enter();
844 bool changed = this->value != v;
845 if (changed || triggerIfSame) {
846 std::swap(this->nextChange, trigger);
847 this->value = v;
848 }
849 lock.leave();
850
851 if (changed || triggerIfSame) {
852 trigger->send(Void());
853 }
854 }
855
856private:
857 V value;

Callers

nothing calls this directly

Calls 5

swapFunction · 0.85
VoidClass · 0.70
enterMethod · 0.45
leaveMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected