MCPcopy Create free account
hub / github.com/bytedance/bolt / yieldIfDue

Method yieldIfDue

bolt/exec/Task.cpp:2968–2979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2966}
2967
2968int32_t Task::yieldIfDue(uint64_t startTimeMicros) {
2969 if (onThreadSince_ < startTimeMicros) {
2970 std::lock_guard<std::timed_mutex> l(mutex_);
2971 // Reread inside the mutex
2972 if (onThreadSince_ < startTimeMicros && numThreads_ && !toYield_ &&
2973 !terminateRequested_ && !pauseRequested_) {
2974 toYield_ = numThreads_;
2975 return numThreads_;
2976 }
2977 }
2978 return 0;
2979}
2980
2981std::vector<ContinuePromise> Task::allThreadsFinishedLocked() {
2982 std::vector<ContinuePromise> threadFinishPromises;

Callers 1

readResultsMethod · 0.80

Calls

no outgoing calls

Tested by 1

readResultsMethod · 0.64