MCPcopy Create free account
hub / github.com/OSGeo/gdal / CPL_STDCALL CPLSetThreadLocalConfigOption

Function CPL_STDCALL CPLSetThreadLocalConfigOption

port/cpl_conv.cpp:2176–2204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2174 */
2175
2176void 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() */

Callers

nothing calls this directly

Tested by

no test coverage detected