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

Method randomTask

bolt/exec/tests/DriverTest.cpp:435–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433 if (it == allTasks_.end()) {
434 return;
435 }
436 allTasks_.erase(it);
437 }
438
439 std::shared_ptr<Task> randomTask() {
440 std::lock_guard<std::mutex> l(taskMutex_);
441 if (allTasks_.empty()) {
442 return nullptr;
443 }
444 return allTasks_[folly::Random::rand32() % allTasks_.size()];

Callers 1

getOutputMethod · 0.80

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected