aboutsummaryrefslogtreecommitdiffstats
path: root/doc/html/libxml-threads.html
blob: 3e432bf0faf1a5aa67c64c2ce7cca1dddd937d35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>threads</title><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><meta xmlns="http://www.w3.org/TR/xhtml1/transitional" name="generator" content="GTK-Doc V1.0 (XML mode)"></meta><style xmlns="http://www.w3.org/TR/xhtml1/transitional" type="text/css">
        .synopsis, .classsynopsis {
            background: #eeeeee;
            border: solid 1px #aaaaaa;
            padding: 0.5em;
        }
        .programlisting {
            background: #eeeeff;
            border: solid 1px #aaaaff;
            padding: 0.5em;
        }
        .variablelist {
            padding: 4px;
            margin-left: 3em;
        }
        .navigation {
            background: #ffeeee;
            border: solid 1px #ffaaaa;
            margin-top: 0.5em;
            margin-bottom: 0.5em;
        }
        .navigation a {
            color: #770000;
        }
        .navigation a:visited {
            color: #550000;
        }
        .navigation .title {
            font-size: 200%;
        }
      </style><link rel="home" href="index.html" title="[Insert name here] Reference Manual"><link rel="up" href="ch01.html" title="[Insert title here]"><link rel="previous" href="libxml-schemasInternals.html" title="schemasInternals"><link rel="next" href="libxml-parser.html" title="parser"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-schemasInternals.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td><th width="100%" align="center">[Insert name here] Reference Manual</th><td><a accesskey="n" href="libxml-parser.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td></tr></table><div class="refentry" lang="en"><a name="libxml-threads"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">threads</span></h2><p>threads &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">



struct      <a href="libxml-threads.html#xmlMutex">xmlMutex</a>;
typedef     <a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a>;
struct      <a href="libxml-threads.html#xmlRMutex">xmlRMutex</a>;
typedef     <a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a>;
<a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> <a href="libxml-threads.html#xmlNewMutex">xmlNewMutex</a>                     (void);
void        <a href="libxml-threads.html#xmlMutexLock">xmlMutexLock</a>                    (<a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok);
void        <a href="libxml-threads.html#xmlMutexUnlock">xmlMutexUnlock</a>                  (<a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok);
void        <a href="libxml-threads.html#xmlFreeMutex">xmlFreeMutex</a>                    (<a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok);
<a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> <a href="libxml-threads.html#xmlNewRMutex">xmlNewRMutex</a>                   (void);
void        <a href="libxml-threads.html#xmlRMutexLock">xmlRMutexLock</a>                   (<a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok);
void        <a href="libxml-threads.html#xmlRMutexUnlock">xmlRMutexUnlock</a>                 (<a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok);
void        <a href="libxml-threads.html#xmlFreeRMutex">xmlFreeRMutex</a>                   (<a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok);
void        <a href="libxml-threads.html#xmlInitThreads">xmlInitThreads</a>                  (void);
void        <a href="libxml-threads.html#xmlLockLibrary">xmlLockLibrary</a>                  (void);
void        <a href="libxml-threads.html#xmlUnlockLibrary">xmlUnlockLibrary</a>                (void);
int         <a href="libxml-threads.html#xmlGetThreadId">xmlGetThreadId</a>                  (void);
int         <a href="libxml-threads.html#xmlIsMainThread">xmlIsMainThread</a>                 (void);
void        <a href="libxml-threads.html#xmlCleanupThreads">xmlCleanupThreads</a>               (void);
<a href="libxml-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a> <a href="libxml-threads.html#xmlGetGlobalState">xmlGetGlobalState</a>         (void);
</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>

</p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="xmlMutex"></a>struct xmlMutex</h3><pre class="programlisting">struct xmlMutex;</pre><p>

</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMutexPtr"></a>xmlMutexPtr</h3><pre class="programlisting">typedef xmlMutex *xmlMutexPtr;
</pre><p>

</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlRMutex"></a>struct xmlRMutex</h3><pre class="programlisting">struct xmlRMutex;</pre><p>

</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlRMutexPtr"></a>xmlRMutexPtr</h3><pre class="programlisting">typedef xmlRMutex *xmlRMutexPtr;
</pre><p>

</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNewMutex"></a>xmlNewMutex ()</h3><pre class="programlisting"><a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> xmlNewMutex                     (void);</pre><p>
<a href="libxml-threads.html#xmlNewMutex">xmlNewMutex</a>() is used to allocate a libxml2 token struct for use in
synchronizing access to data.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a new simple mutex pointer or NULL in case of error
</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMutexLock"></a>xmlMutexLock ()</h3><pre class="programlisting">void        xmlMutexLock                    (<a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok);</pre><p>
<a href="libxml-threads.html#xmlMutexLock">xmlMutexLock</a>() is used to lock a libxml2 token.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>tok</tt></i> :</span></td><td>  the simple mutex
</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMutexUnlock"></a>xmlMutexUnlock ()</h3><pre class="programlisting">void        xmlMutexUnlock                  (<a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok);</pre><p>
<a href="libxml-threads.html#xmlMutexUnlock">xmlMutexUnlock</a>() is used to unlock a libxml2 token.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>tok</tt></i> :</span></td><td>  the simple mutex
</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlFreeMutex"></a>xmlFreeMutex ()</h3><pre class="programlisting">void        xmlFreeMutex                    (<a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok);</pre><p>
<a href="libxml-threads.html#xmlFreeMutex">xmlFreeMutex</a>() is used to reclaim resources associated with a libxml2 token
struct.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>tok</tt></i> :</span></td><td>  the simple mutex
</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNewRMutex"></a>xmlNewRMutex ()</h3><pre class="programlisting"><a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> xmlNewRMutex                   (void);</pre><p>
<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlRNewMutex">xmlRNewMutex</GTKDOCLINK>() 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.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the new reentrant mutex pointer or NULL in case of error
</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlRMutexLock"></a>xmlRMutexLock ()</h3><pre class="programlisting">void        xmlRMutexLock                   (<a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok);</pre><p>
<a href="libxml-threads.html#xmlRMutexLock">xmlRMutexLock</a>() is used to lock a libxml2 token_r.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>tok</tt></i> :</span></td><td>  the reentrant mutex
</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlRMutexUnlock"></a>xmlRMutexUnlock ()</h3><pre class="programlisting">void        xmlRMutexUnlock                 (<a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok);</pre><p>
<a href="libxml-threads.html#xmlRMutexUnlock">xmlRMutexUnlock</a>() is used to unlock a libxml2 token_r.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>tok</tt></i> :</span></td><td>  the reentrant mutex
</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlFreeRMutex"></a>xmlFreeRMutex ()</h3><pre class="programlisting">void        xmlFreeRMutex                   (<a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok);</pre><p>
<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="xmlRFreeMutex">xmlRFreeMutex</GTKDOCLINK>() is used to reclaim resources associated with a
reentrant mutex.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>tok</tt></i> :</span></td><td>  the reentrant mutex
</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlInitThreads"></a>xmlInitThreads ()</h3><pre class="programlisting">void        xmlInitThreads                  (void);</pre><p>
<a href="libxml-threads.html#xmlInitThreads">xmlInitThreads</a>() is used to to initialize all the thread related
data of the libxml2 library.</p><p>

</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlLockLibrary"></a>xmlLockLibrary ()</h3><pre class="programlisting">void        xmlLockLibrary                  (void);</pre><p>
<a href="libxml-threads.html#xmlLockLibrary">xmlLockLibrary</a>() is used to take out a re-entrant lock on the libxml2
library.</p><p>

</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlUnlockLibrary"></a>xmlUnlockLibrary ()</h3><pre class="programlisting">void        xmlUnlockLibrary                (void);</pre><p>
<a href="libxml-threads.html#xmlUnlockLibrary">xmlUnlockLibrary</a>() is used to release a re-entrant lock on the libxml2
library.</p><p>

</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlGetThreadId"></a>xmlGetThreadId ()</h3><pre class="programlisting">int         xmlGetThreadId                  (void);</pre><p>
<a href="libxml-threads.html#xmlGetThreadId">xmlGetThreadId</a>() find the current thread ID number</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the current thread ID number
</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlIsMainThread"></a>xmlIsMainThread ()</h3><pre class="programlisting">int         xmlIsMainThread                 (void);</pre><p>
<a href="libxml-threads.html#xmlIsMainThread">xmlIsMainThread</a>() check whether the current thread is the main thread.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>1 if the current thread is the main thread, 0 otherwise
</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlCleanupThreads"></a>xmlCleanupThreads ()</h3><pre class="programlisting">void        xmlCleanupThreads               (void);</pre><p>
<a href="libxml-threads.html#xmlCleanupThreads">xmlCleanupThreads</a>() is used to to cleanup all the thread related
data of the libxml2 library once processing has ended.</p><p>

</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlGetGlobalState"></a>xmlGetGlobalState ()</h3><pre class="programlisting"><a href="libxml-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a> xmlGetGlobalState         (void);</pre><p>
<a href="libxml-threads.html#xmlGetGlobalState">xmlGetGlobalState</a>() is called to retrieve the global state for a thread.</p><p>

</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the thread global state or NULL in case of error
</td></tr></tbody></table></div></div></div></div><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxml-schemasInternals.html"><b>&lt;&lt; schemasInternals</b></a></td><td align="right"><a accesskey="n" href="libxml-parser.html"><b>parser &gt;&gt;</b></a></td></tr></table></body></html>