MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlGetThreadLocalStorage

Function xmlGetThreadLocalStorage

ThirdParty/libxml2/vtklibxml2/globals.c:856–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854#endif
855
856static xmlGlobalStatePtr
857xmlGetThreadLocalStorage(int allowFailure) {
858 xmlGlobalState *gs;
859
860 (void) allowFailure;
861
862#ifdef USE_TLS
863 gs = &globalState;
864 if (gs->initialized == 0)
865 xmlInitGlobalState(gs);
866#elif defined(HAVE_POSIX_THREADS)
867 gs = (xmlGlobalState *) pthread_getspecific(globalkey);
868 if (gs == NULL)
869 gs = xmlNewGlobalState(allowFailure);
870#elif defined(HAVE_WIN32_THREADS)
871 gs = (xmlGlobalState *) TlsGetValue(globalkey);
872 if (gs == NULL)
873 gs = xmlNewGlobalState(allowFailure);
874#else
875 gs = NULL;
876#endif
877
878 return(gs);
879}
880
881/* Define thread-local storage accessors with macro magic */
882

Callers 2

xmlGetLocalRngStateFunction · 0.85

Calls 2

xmlInitGlobalStateFunction · 0.85
xmlNewGlobalStateFunction · 0.85

Tested by

no test coverage detected