MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / startMoreThreadsIfNeeded

Method startMoreThreadsIfNeeded

src/Common/threadPoolCallbackRunner.cpp:55–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void ThreadPoolCallbackRunnerFast::startMoreThreadsIfNeeded(size_t active_tasks_, std::unique_lock<std::mutex> &)
56{
57 while (threads < max_threads && threads < active_tasks_ && !shutdown_requested)
58 {
59 pool->scheduleOrThrow([this] { threadFunction(); });
60 ++threads; // only if scheduleOrThrow didn't throw
61 }
62}
63
64void ThreadPoolCallbackRunnerFast::operator()(std::function<void()> f)
65{

Callers

nothing calls this directly

Calls 2

scheduleOrThrowMethod · 0.80
threadFunctionFunction · 0.50

Tested by

no test coverage detected