MCPcopy Create free account
hub / github.com/apache/arrow / LaunchWorkersUnlocked

Method LaunchWorkersUnlocked

cpp/src/arrow/util/thread_pool.cc:695–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693bool ThreadPool::OwnsThisThread() { return GetCurrentThreadPool() == this; }
694
695void ThreadPool::LaunchWorkersUnlocked(int threads) {
696 std::shared_ptr<State> state = sp_state_;
697
698 for (int i = 0; i < threads; i++) {
699 state_->workers_.emplace_back();
700 auto it = --(state_->workers_.end());
701 *it = std::thread([this, state, it] {
702 SetCurrentThreadPool(this);
703 WorkerLoop(state, it);
704 });
705 }
706}
707
708Status ThreadPool::SpawnReal(TaskHints hints, FnOnce<void()> task, StopToken stop_token,
709 StopCallback&& stop_callback) {

Callers

nothing calls this directly

Calls 4

SetCurrentThreadPoolFunction · 0.85
WorkerLoopFunction · 0.85
emplace_backMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected