Warning: the CPLTLSFreeFunc must not in any case directly or indirectly use or fetch any TLS data, or a terminating thread will hang!
| 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! |
| 2328 | void 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. |
no test coverage detected