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

Function CPLSetTLSWithFreeFunc

port/cpl_multiproc.cpp:2311–2320  ·  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

2309// Warning: The CPLTLSFreeFunc must not in any case directly or indirectly
2310// use or fetch any TLS data, or a terminating thread will hang!
2311void CPLSetTLSWithFreeFunc(int nIndex, void *pData, CPLTLSFreeFunc pfnFree)
2312
2313{
2314 void **l_papTLSList = CPLGetTLSList(nullptr);
2315
2316 CPLAssert(nIndex >= 0 && nIndex < CTLS_MAX);
2317
2318 l_papTLSList[nIndex] = pData;
2319 l_papTLSList[CTLS_MAX + nIndex] = reinterpret_cast<void *>(pfnFree);
2320}
2321
2322/************************************************************************/
2323/* CPLSetTLSWithFreeFuncEx() */

Callers 6

CPLCondTimedWaitFunction · 0.85
CPLSetTLSFunction · 0.85
CSVAccessFunction · 0.85
CPLGetFindFileTLSFunction · 0.85

Calls 1

CPLGetTLSListFunction · 0.85

Tested by

no test coverage detected