Blame doc/devhelp/libxml2-threads.html

Packit 423ecb
Packit 423ecb
<html>
Packit 423ecb
  <head>
Packit 423ecb
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
Packit 423ecb
    <title>threads: interfaces for thread handling</title>
Packit 423ecb
    <meta name="generator" content="Libxml2 devhelp stylesheet"/>
Packit 423ecb
    <link rel="start" href="index.html" title="libxml2 Reference Manual"/>
Packit 423ecb
    <link rel="up" href="general.html" title="API"/>
Packit 423ecb
    <link rel="stylesheet" href="style.css" type="text/css"/>
Packit 423ecb
    <link rel="chapter" href="general.html" title="API"/>
Packit 423ecb
  </head>
Packit 423ecb
  <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit 423ecb
    
Packit 423ecb
      
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Prev
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Up
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Home
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Next
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        libxml2 Reference Manual
Packit 423ecb
      
Packit 423ecb
    
Packit 423ecb
    

Packit 423ecb
      threads
Packit 423ecb
    
Packit 423ecb
    

threads - interfaces for thread handling

Packit 423ecb
    

set of generic threading related routines should work with pthreads, Windows native or TLS threads

Packit 423ecb
    

Author(s): Daniel Veillard

Packit 423ecb
    
Packit 423ecb
      

Synopsis

Packit 423ecb
      
typedef struct _xmlMutex xmlMutex;
Packit 423ecb
typedef struct _xmlRMutex xmlRMutex;
Packit 423ecb
typedef xmlRMutex * xmlRMutexPtr;
Packit 423ecb
typedef xmlMutex * xmlMutexPtr;
Packit 423ecb
void	xmlFreeRMutex			(xmlRMutexPtr tok);
Packit 423ecb
int	xmlGetThreadId			(void);
Packit 423ecb
void	xmlMutexUnlock			(xmlMutexPtr tok);
Packit 423ecb
void	xmlCleanupThreads		(void);
Packit 423ecb
void	xmlLockLibrary			(void);
Packit 423ecb
xmlRMutexPtr	xmlNewRMutex		(void);
Packit 423ecb
void	xmlMutexLock			(xmlMutexPtr tok);
Packit 423ecb
int	xmlIsMainThread			(void);
Packit 423ecb
void	xmlRMutexUnlock			(xmlRMutexPtr tok);
Packit 423ecb
xmlGlobalStatePtr	xmlGetGlobalState	(void);
Packit 423ecb
xmlMutexPtr	xmlNewMutex		(void);
Packit 423ecb
int	xmlDllMain			(void * hinstDLL, 
unsigned long fdwReason,
void * lpvReserved);
Packit 423ecb
void	xmlFreeMutex			(xmlMutexPtr tok);
Packit 423ecb
void	xmlUnlockLibrary		(void);
Packit 423ecb
void	xmlInitThreads			(void);
Packit 423ecb
void	xmlRMutexLock			(xmlRMutexPtr tok);
Packit 423ecb
Packit 423ecb
    
Packit 423ecb
    
Packit 423ecb
      

Description

Packit 423ecb
    
Packit 423ecb
    
Packit 423ecb
      

Details

Packit 423ecb
      
Packit 423ecb
        

Structure xmlMutex

struct _xmlMutex {
Packit 423ecb
The content of this structure is not made public by the API.
Packit 423ecb
} xmlMutex;
Packit 423ecb

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        

Typedef xmlMutexPtr

xmlMutex * xmlMutexPtr;
Packit 423ecb

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        

Structure xmlRMutex

struct _xmlRMutex {
Packit 423ecb
The content of this structure is not made public by the API.
Packit 423ecb
} xmlRMutex;
Packit 423ecb

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        

Typedef xmlRMutexPtr

xmlRMutex * xmlRMutexPtr;
Packit 423ecb

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlCleanupThreads() is used to to cleanup all the thread related data of the libxml2 library once processing has ended. 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 !

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Packit 423ecb
<tt>hinstDLL</tt>:
<tt>fdwReason</tt>:
<tt>lpvReserved</tt>:
<tt>Returns</tt>:
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlFreeMutex() is used to reclaim resources associated with a libxml2 token struct.

Packit 423ecb
<tt>tok</tt>:the simple mutex
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlRFreeMutex() is used to reclaim resources associated with a reentrant mutex.

Packit 423ecb
<tt>tok</tt>:the reentrant mutex
Packit 423ecb
        
Packit 423ecb
        

xmlGetGlobalState ()

xmlGlobalStatePtr	xmlGetGlobalState	(void)
Packit 423ecb

xmlGetGlobalState() is called to retrieve the global state for a thread.

Packit 423ecb
<tt>Returns</tt>:the thread global state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

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

Packit 423ecb
<tt>Returns</tt>:the current thread ID number
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlInitThreads() is used to to initialize all the thread related data of the libxml2 library.

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlIsMainThread() check whether the current thread is the main thread.

Packit 423ecb
<tt>Returns</tt>:1 if the current thread is the main thread, 0 otherwise
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlLockLibrary() is used to take out a re-entrant lock on the libxml2 library.

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlMutexLock() is used to lock a libxml2 token.

Packit 423ecb
<tt>tok</tt>:the simple mutex
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlMutexUnlock() is used to unlock a libxml2 token.

Packit 423ecb
<tt>tok</tt>:the simple mutex
Packit 423ecb
        
Packit 423ecb
        

xmlNewMutex ()

xmlMutexPtr	xmlNewMutex		(void)
Packit 423ecb

xmlNewMutex() is used to allocate a libxml2 token struct for use in synchronizing access to data.

Packit 423ecb
<tt>Returns</tt>:a new simple mutex pointer or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        

xmlNewRMutex ()

xmlRMutexPtr	xmlNewRMutex		(void)
Packit 423ecb

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.

Packit 423ecb
<tt>Returns</tt>:the new reentrant mutex pointer or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlRMutexLock() is used to lock a libxml2 token_r.

Packit 423ecb
<tt>tok</tt>:the reentrant mutex
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlRMutexUnlock() is used to unlock a libxml2 token_r.

Packit 423ecb
<tt>tok</tt>:the reentrant mutex
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

xmlUnlockLibrary() is used to release a re-entrant lock on the libxml2 library.

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
      
Packit 423ecb
    
Packit 423ecb
  </body>
Packit 423ecb
</html>