| 2174 | */ |
| 2175 | |
| 2176 | void CPL_STDCALL CPLSetThreadLocalConfigOption(const char *pszKey, |
| 2177 | const char *pszValue) |
| 2178 | |
| 2179 | { |
| 2180 | #ifdef DEBUG_CONFIG_OPTIONS |
| 2181 | CPLAccessConfigOption(pszKey, FALSE); |
| 2182 | #endif |
| 2183 | |
| 2184 | #ifdef OGRAPISPY_ENABLED |
| 2185 | OGRAPISPYCPLSetThreadLocalConfigOption(pszKey, pszValue); |
| 2186 | #endif |
| 2187 | |
| 2188 | int bMemoryError = FALSE; |
| 2189 | char **papszTLConfigOptions = reinterpret_cast<char **>( |
| 2190 | CPLGetTLSEx(CTLS_CONFIGOPTIONS, &bMemoryError)); |
| 2191 | if (bMemoryError) |
| 2192 | return; |
| 2193 | |
| 2194 | CPLSetConfigOptionDetectUnknownConfigOption(pszKey, pszValue); |
| 2195 | |
| 2196 | papszTLConfigOptions = |
| 2197 | CSLSetNameValue(papszTLConfigOptions, pszKey, pszValue); |
| 2198 | |
| 2199 | CPLSetTLSWithFreeFunc(CTLS_CONFIGOPTIONS, papszTLConfigOptions, |
| 2200 | CPLSetThreadLocalTLSFreeFunc); |
| 2201 | |
| 2202 | NotifyOtherComponentsConfigOptionChanged(pszKey, pszValue, |
| 2203 | /*bTheadLocal=*/true); |
| 2204 | } |
| 2205 | |
| 2206 | /************************************************************************/ |
| 2207 | /* CPLGetThreadLocalConfigOptions() */ |
nothing calls this directly
no test coverage detected