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

Class FutureInfo

fdbclient/MultiVersionTransaction.actor.cpp:3022–3043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3020};
3021
3022struct FutureInfo {
3023 FutureInfo() {
3024 if (deterministicRandom()->coinflip()) {
3025 expectedValue = Error(deterministicRandom()->randomInt(1, 100));
3026 } else {
3027 expectedValue = deterministicRandom()->randomInt(0, 100);
3028 }
3029 }
3030
3031 FutureInfo(ThreadFuture<int> future, ErrorOr<int> expectedValue, std::set<int> legalErrors = std::set<int>())
3032 : future(future), expectedValue(expectedValue), legalErrors(legalErrors) {}
3033
3034 void validate() {
3035 int userParam;
3036 future.callOrSetAsCallback(new ValidateFuture(future, expectedValue, legalErrors), userParam, 0);
3037 }
3038
3039 ThreadFuture<int> future;
3040 ErrorOr<int> expectedValue;
3041 std::set<int> legalErrors;
3042 std::vector<THREAD_HANDLE> threads;
3043};
3044
3045FutureInfo createVarOnMainThread(bool canBeNever = true) {
3046 FutureInfo f;

Callers 3

createThreadFutureMethod · 0.85
createThreadFutureMethod · 0.85
createThreadFutureMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected