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

Function CPLSetTLSWithFreeFuncEx

port/cpl_multiproc.cpp:2328–2338  ·  view source on GitHub ↗

Warning: the CPLTLSFreeFunc must not in any case directly or indirectly use or fetch any TLS data, or a terminating thread will hang!

Source from the content-addressed store, hash-verified

2326// Warning: the CPLTLSFreeFunc must not in any case directly or indirectly
2327// use or fetch any TLS data, or a terminating thread will hang!
2328void CPLSetTLSWithFreeFuncEx(int nIndex, void *pData, CPLTLSFreeFunc pfnFree,
2329 int *pbMemoryErrorOccurred)
2330
2331{
2332 void **l_papTLSList = CPLGetTLSList(pbMemoryErrorOccurred);
2333
2334 CPLAssert(nIndex >= 0 && nIndex < CTLS_MAX);
2335
2336 l_papTLSList[nIndex] = pData;
2337 l_papTLSList[CTLS_MAX + nIndex] = reinterpret_cast<void *>(pfnFree);
2338}
2339#ifndef HAVE_SPINLOCK_IMPL
2340
2341// No spinlock specific API? Fallback to mutex.

Callers 9

ogr_proj_p.cppFile · 0.85
gdaldataset.cppFile · 0.85
CPLErrorVFunction · 0.85
CPLErrorSetStateFunction · 0.85
cpl_vsil_curl.cppFile · 0.85
CPLFinderCleanFunction · 0.85
GetHTTPFetchContextFunction · 0.85

Calls 1

CPLGetTLSListFunction · 0.85

Tested by

no test coverage detected