MCPcopy Create free account
hub / github.com/OSGeo/gdal / GDALGetGlobalThreadPool

Function GDALGetGlobalThreadPool

gcore/gdal_thread_pool.cpp:34–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34CPLWorkerThreadPool *GDALGetGlobalThreadPool(int nThreads)
35{
36 std::lock_guard oGuard(GetMutexThreadPool());
37 if (gpoCompressThreadPool == nullptr)
38 {
39 gpoCompressThreadPool = new CPLWorkerThreadPool();
40 if (!gpoCompressThreadPool->Setup(nThreads, nullptr, nullptr, false))
41 {
42 delete gpoCompressThreadPool;
43 gpoCompressThreadPool = nullptr;
44 }
45 }
46 else if (nThreads > gpoCompressThreadPool->GetThreadCount())
47 {
48 // Increase size of thread pool
49 gpoCompressThreadPool->Setup(nThreads, nullptr, nullptr, false);
50 }
51 return gpoCompressThreadPool;
52}
53
54void GDALDestroyGlobalThreadPool()
55{

Callers 14

GWKThreadsCreateFunction · 0.85
OpenMethod · 0.85
PreloadShardedBlocksMethod · 0.85
IAdviseReadMethod · 0.85
IWriteMethod · 0.85
IAdviseReadMethod · 0.85
BatchDecodePartialMethod · 0.85
IRasterIOMethod · 0.85

Calls 2

GetThreadCountMethod · 0.80
SetupMethod · 0.45

Tested by

no test coverage detected