|
ReactOS 0.4.16-dev-2232-gc2aaa52
|
#include "libxml.h"#include <string.h>#include <stdlib.h>#include <libxml/threads.h>#include <libxml/parser.h>#include "private/dict.h"#include "private/enc.h"#include "private/globals.h"#include "private/memory.h"#include "private/threads.h"#include "private/xpath.h"
Go to the source code of this file.
Classes | |
| struct | _xmlRMutex |
Macros | |
| #define | IN_LIBXML |
| #define | XML_IS_THREADED() 1 |
| #define | XML_IS_NEVER_THREADED() 0 |
Functions | |
| void | xmlInitMutex (xmlMutexPtr mutex) |
| xmlMutexPtr | xmlNewMutex (void) |
| void | xmlCleanupMutex (xmlMutexPtr mutex) |
| void | xmlFreeMutex (xmlMutexPtr tok) |
| void | xmlMutexLock (xmlMutexPtr tok) |
| void | xmlMutexUnlock (xmlMutexPtr tok) |
| xmlRMutexPtr | xmlNewRMutex (void) |
| void | xmlFreeRMutex (xmlRMutexPtr tok ATTRIBUTE_UNUSED) |
| void | xmlRMutexLock (xmlRMutexPtr tok) |
| void | xmlRMutexUnlock (xmlRMutexPtr tok ATTRIBUTE_UNUSED) |
| int | xmlGetThreadId (void) |
| void | xmlLockLibrary (void) |
| void | xmlUnlockLibrary (void) |
| void | xmlInitThreads (void) |
| void | xmlCleanupThreads (void) |
| static void | xmlGlobalInitMutexLock (void) |
| static void | xmlGlobalInitMutexUnlock (void) |
| static void | xmlGlobalInitMutexDestroy (void) |
| void | xmlInitParser (void) |
| void | xmlCleanupParser (void) |
Variables | |
| static xmlRMutexPtr | xmlLibraryLock = NULL |
| static int | xmlParserInitialized = 0 |
| static int | xmlParserInnerInitialized = 0 |
| #define IN_LIBXML |
threads.c: set of generic threading related routines
See Copyright for the status of this software.
Gary Pennington Gary..nosp@m.Penn.nosp@m.ingto.nosp@m.n@uk.nosp@m..sun..nosp@m.com danie.nosp@m.l@ve.nosp@m.illar.nosp@m.d.co.nosp@m.m
| void xmlCleanupMutex | ( | xmlMutexPtr | mutex | ) |
xmlCleanupMutex: @mutex: the simple mutex
Reclaim resources associated with a mutex.
Definition at line 166 of file threads.c.
Referenced by xmlCleanupDictInternal(), xmlCleanupGlobalsInternal(), xmlCleanupMemoryInternal(), xmlCleanupRandom(), and xmlFreeMutex().
xmlCleanupParser:
This function name is somewhat misleading. It does not clean up parser state, it cleans up memory allocated by the library itself. It is a cleanup function for the XML library. It tries to reclaim all related global memory allocated for the library processing. It doesn't deallocate any document related memory. One should call xmlCleanupParser() only when the process has finished using the library and all XML/HTML documents built with it. See also xmlInitParser() which has the opposite function of preparing the library for operations.
WARNING: if your application is multithreaded or has plugin support calling this may crash the application if another thread or a plugin is still using libxml2. It's sometimes very hard to guess if libxml2 is in use in the application, some libraries or plugins may use it without notice. In case of doubt abstain from calling this function or do it just before calling exit() to avoid leak reports from valgrind !
Definition at line 630 of file threads.c.
Referenced by DllMain(), and xmlInitParser().
xmlCleanupThreads:
DEPRECATED: This function is a no-op. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don't have call cleanup functions at all.
Definition at line 435 of file threads.c.
| void xmlFreeMutex | ( | xmlMutexPtr | tok | ) |
xmlFreeMutex: @tok: the simple mutex
Free a mutex.
Definition at line 185 of file threads.c.
Referenced by xsltCleanupGlobals().
| void xmlFreeRMutex | ( | xmlRMutexPtr tok | ATTRIBUTE_UNUSED | ) |
xmlFreeRMutex: @tok: the reentrant mutex
xmlRFreeMutex() is used to reclaim resources associated with a reentrant mutex.
Definition at line 275 of file threads.c.
Referenced by xsltUninit().
xmlGetThreadId:
DEPRECATED: Internal function, do not use.
xmlGetThreadId() find the current thread ID number Note that this is likely to be broken on some platforms using pthreads as the specification doesn't mandate pthread_t to be an integer type
Returns the current thread ID number
Definition at line 372 of file threads.c.
xmlGlobalInitMutexDestroy
Makes sure that the global initialization mutex is destroyed before application termination.
Definition at line 549 of file threads.c.
Referenced by xmlCleanupParser().
xmlGlobalInitMutexLock
Makes sure that the global initialization mutex is initialized and locks it.
Definition at line 462 of file threads.c.
Referenced by xmlInitParser().
Definition at line 532 of file threads.c.
Referenced by xmlInitParser().
| void xmlInitMutex | ( | xmlMutexPtr | mutex | ) |
xmlInitMutex: @mutex: the mutex
Initialize a mutex.
Definition at line 128 of file threads.c.
Referenced by xmlInitDictInternal(), xmlInitGlobalsInternal(), xmlInitMemoryInternal(), xmlInitRandom(), and xmlNewMutex().
xmlInitParser:
Initialization function for the XML parser.
Call once from the main thread before using the library in multithreaded programs.
Definition at line 569 of file threads.c.
Referenced by DllMain(), xmlCheckVersion(), xmlCtxtReadDoc(), xmlCtxtReadFd(), xmlCtxtReadFile(), xmlCtxtReadIO(), xmlCtxtReadMemory(), xmlDictCreate(), xmlHashCreate(), xmlInitCharEncodingHandlers(), xmlInitGlobals(), xmlInitializeDict(), xmlInitMemory(), xmlInitSAXParserCtxt(), xmlInitThreads(), xmlIsMainThreadInternal(), xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemStrdupLoc(), xmlParseDocument(), xmlReadDoc(), xmlReadFd(), xmlReadFile(), xmlReadIO(), xmlReadMemory(), and xmlReallocLoc().
xmlInitThreads:
DEPRECATED: Alias for xmlInitParser.
xmlLockLibrary:
xmlLockLibrary() is used to take out a re-entrant lock on the libxml2 library.
Definition at line 398 of file threads.c.
| void xmlMutexLock | ( | xmlMutexPtr | tok | ) |
xmlMutexLock: @tok: the simple mutex
xmlMutexLock() is used to lock a libxml2 token.
Definition at line 201 of file threads.c.
Referenced by xmlDictFree(), xmlDictReference(), xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemBlocks(), xmlMemDisplay(), xmlMemDisplayLast(), xmlMemFree(), xmlMemShow(), xmlMemStrdupLoc(), xmlRandom(), xmlReallocLoc(), xmlThrDefBufferAllocScheme(), xmlThrDefDefaultBufferSize(), xmlThrDefDeregisterNodeDefault(), xmlThrDefDoValidityCheckingDefaultValue(), xmlThrDefGetWarningsDefaultValue(), xmlThrDefKeepBlanksDefaultValue(), xmlThrDefLineNumbersDefaultValue(), xmlThrDefLoadExtDtdDefaultValue(), xmlThrDefOutputBufferCreateFilenameDefault(), xmlThrDefParserDebugEntities(), xmlThrDefParserInputBufferCreateFilenameDefault(), xmlThrDefPedanticParserDefaultValue(), xmlThrDefRegisterNodeDefault(), xmlThrDefSetGenericErrorFunc(), xmlThrDefSetStructuredErrorFunc(), xmlThrDefSubstituteEntitiesDefaultValue(), xsltCleanupGlobals(), xsltDebugDumpExtensions(), xsltExtModuleElementLookup(), xsltExtModuleElementPreComputeLookup(), xsltExtModuleFunctionLookup(), xsltExtModuleTopLevelLookup(), xsltGetExtData(), xsltPreComputeExtModuleElement(), xsltRegisterExtModuleElement(), xsltRegisterExtModuleFull(), xsltRegisterExtModuleFunction(), xsltRegisterExtModuleTopLevel(), xsltRegisterExtPrefix(), xsltStyleInitializeStylesheetModule(), xsltUnregisterAllExtModuleElement(), xsltUnregisterAllExtModuleFunction(), xsltUnregisterAllExtModules(), xsltUnregisterAllExtModuleTopLevel(), xsltUnregisterExtModule(), xsltUnregisterExtModuleElement(), xsltUnregisterExtModuleFunction(), and xsltUnregisterExtModuleTopLevel().
| void xmlMutexUnlock | ( | xmlMutexPtr | tok | ) |
xmlMutexUnlock: @tok: the simple mutex
xmlMutexUnlock() is used to unlock a libxml2 token.
Definition at line 225 of file threads.c.
Referenced by xmlDictFree(), xmlDictReference(), xmlMallocAtomicLoc(), xmlMallocLoc(), xmlMemBlocks(), xmlMemDisplay(), xmlMemDisplayLast(), xmlMemFree(), xmlMemShow(), xmlMemStrdupLoc(), xmlRandom(), xmlReallocLoc(), xmlThrDefBufferAllocScheme(), xmlThrDefDefaultBufferSize(), xmlThrDefDeregisterNodeDefault(), xmlThrDefDoValidityCheckingDefaultValue(), xmlThrDefGetWarningsDefaultValue(), xmlThrDefKeepBlanksDefaultValue(), xmlThrDefLineNumbersDefaultValue(), xmlThrDefLoadExtDtdDefaultValue(), xmlThrDefOutputBufferCreateFilenameDefault(), xmlThrDefParserDebugEntities(), xmlThrDefParserInputBufferCreateFilenameDefault(), xmlThrDefPedanticParserDefaultValue(), xmlThrDefRegisterNodeDefault(), xmlThrDefSetGenericErrorFunc(), xmlThrDefSetStructuredErrorFunc(), xmlThrDefSubstituteEntitiesDefaultValue(), xsltCleanupGlobals(), xsltDebugDumpExtensions(), xsltExtModuleElementLookup(), xsltExtModuleElementPreComputeLookup(), xsltExtModuleFunctionLookup(), xsltExtModuleTopLevelLookup(), xsltGetExtData(), xsltPreComputeExtModuleElement(), xsltRegisterExtModuleElement(), xsltRegisterExtModuleFull(), xsltRegisterExtModuleFunction(), xsltRegisterExtModuleTopLevel(), xsltRegisterExtPrefix(), xsltStyleInitializeStylesheetModule(), xsltUnregisterAllExtModuleElement(), xsltUnregisterAllExtModuleFunction(), xsltUnregisterAllExtModules(), xsltUnregisterAllExtModuleTopLevel(), xsltUnregisterExtModule(), xsltUnregisterExtModuleElement(), xsltUnregisterExtModuleFunction(), and xsltUnregisterExtModuleTopLevel().
| xmlMutexPtr xmlNewMutex | ( | void | ) |
xmlNewMutex:
xmlNewMutex() is used to allocate a libxml2 token struct for use in synchronizing access to data.
Returns a new simple mutex pointer or NULL in case of error
Definition at line 149 of file threads.c.
Referenced by xsltInitGlobals().
| xmlRMutexPtr xmlNewRMutex | ( | void | ) |
xmlNewRMutex:
xmlRNewMutex() is used to allocate a reentrant mutex for use in synchronizing access to data. token_r is a re-entrant lock and thus useful for synchronizing access to data structures that may be manipulated in a recursive fashion.
Returns the new reentrant mutex pointer or NULL in case of error
Definition at line 248 of file threads.c.
Referenced by xsltInit().
| void xmlRMutexLock | ( | xmlRMutexPtr | tok | ) |
xmlRMutexLock: @tok: the reentrant mutex
xmlRMutexLock() is used to lock a libxml2 token_r.
Definition at line 297 of file threads.c.
Referenced by xmlLockLibrary(), and xsltFreeLocales().
| void xmlRMutexUnlock | ( | xmlRMutexPtr tok | ATTRIBUTE_UNUSED | ) |
xmlRMutexUnlock: @tok: the reentrant mutex
xmlRMutexUnlock() is used to unlock a libxml2 token_r.
Definition at line 333 of file threads.c.
Referenced by xmlUnlockLibrary(), and xsltFreeLocales().
xmlUnlockLibrary:
xmlUnlockLibrary() is used to release a re-entrant lock on the libxml2 library.
Definition at line 410 of file threads.c.
|
static |
Definition at line 119 of file threads.c.
Referenced by xmlLockLibrary(), and xmlUnlockLibrary().
|
static |
Definition at line 445 of file threads.c.
Referenced by xmlCleanupParser(), and xmlInitParser().
|
static |
Definition at line 446 of file threads.c.
Referenced by xmlCleanupParser(), and xmlInitParser().