ReactOS 0.4.16-dev-2132-g3885311
globals.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

XML_HIDDEN void xmlInitGlobalsInternal (void)
 
XML_HIDDEN void xmlCleanupGlobalsInternal (void)
 

Function Documentation

◆ xmlCleanupGlobalsInternal()

XML_HIDDEN void xmlCleanupGlobalsInternal ( void  )

xmlCleanupGlobalsInternal:

Additional cleanup for multi-threading

Definition at line 617 of file globals.c.

617 {
619
621
622#ifdef HAVE_POSIX_THREADS
623#ifdef XML_PTHREAD_WEAK
624 if (libxml_is_threaded == 0)
625 return;
626#endif /* XML_PTHREAD_WEAK */
627 pthread_key_delete(globalkey);
628#elif defined(HAVE_WIN32_THREADS)
629#ifndef USE_TLS
630 if (globalkey != TLS_OUT_OF_INDEXES) {
631 TlsFree(globalkey);
632 globalkey = TLS_OUT_OF_INDEXES;
633 }
634#endif
635#endif
636
638}
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1166
XML_HIDDEN void xmlCleanupMutex(xmlMutexPtr mutex)
Definition: threads.c:166
xmlError xmlLastError
Definition: globals.c:419
static int parserInitialized
Definition: globals.c:89
static xmlMutex xmlThrDefMutex
Definition: globals.c:94
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:529
XMLPUBFUN void xmlResetError(xmlErrorPtr err)

Referenced by xmlCleanupParser().

◆ xmlInitGlobalsInternal()

XML_HIDDEN void xmlInitGlobalsInternal ( void  )

xmlInitGlobalsInternal:

Additional initialisation for multi-threading

Definition at line 571 of file globals.c.

571 {
573
574#ifdef HAVE_POSIX_THREADS
575#ifdef XML_PTHREAD_WEAK
576 if (libxml_is_threaded == -1)
577 libxml_is_threaded =
578 (pthread_getspecific != NULL) &&
579 (pthread_setspecific != NULL) &&
580 (pthread_key_create != NULL) &&
581 (pthread_key_delete != NULL) &&
582 /*
583 * pthread_equal can be inline, resuting in -Waddress warnings.
584 * Let's assume it's available if all the other functions are.
585 */
586 /* (pthread_equal != NULL) && */
587 (pthread_self != NULL);
588 if (libxml_is_threaded == 0)
589 return;
590#endif /* XML_PTHREAD_WEAK */
591 pthread_key_create(&globalkey, xmlFreeGlobalState);
592 mainthread = pthread_self();
593#elif defined(HAVE_WIN32_THREADS)
594#ifndef USE_TLS
595 globalkey = TlsAlloc();
596#endif
597 mainthread = GetCurrentThreadId();
598#endif
599}
#define NULL
Definition: types.h:112
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
Definition: thread.c:657
XML_HIDDEN void xmlInitMutex(xmlMutexPtr mutex)
Definition: threads.c:128
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459

Referenced by xmlInitParser().