Debian Codegraph @

docs/api_reference/CXX/mutexalloc.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DbEnv::mutex_alloc()</title>
7 <link rel="stylesheet" href="apiReference.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" />
10 <link rel="up" href="mutex.html" title="Chapter 10.  Mutex Methods" />
11 <link rel="prev" href="mutex.html" title="Chapter 10.  Mutex Methods" />
12 <link rel="next" href="mutexfree.html" title="DbEnv::mutex_free()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DbEnv::mutex_alloc()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="mutex.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 10. 
26 Mutex Methods
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="mutexfree.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="mutexalloc"></a>DbEnv::mutex_alloc()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::mutex_alloc(u_int32_t flags, db_mutex_t *mutexp);</pre>
45 <p>
46 The <code class="methodname">DbEnv::mutex_alloc()</code> method allocates a mutex and returns a
47 reference to it into the memory specified by <span class="bold"><strong>mutexp</strong></span>.
48 </p>
49 <p>
50 The <code class="methodname">DbEnv::mutex_alloc()</code> method may not be called before the
51 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method is called.
52 </p>
53 <p>
54 The <code class="methodname">DbEnv::mutex_alloc()</code> <span>
55
56 <span>
57 method either returns a non-zero error value or throws an
58 exception that encapsulates a non-zero error value on
59 failure, and returns 0 on success.
60 </span>
61 </span>
62 </p>
63 <div class="sect2" lang="en" xml:lang="en">
64 <div class="titlepage">
65 <div>
66 <div>
67 <h3 class="title"><a id="idp9116712"></a>Parameters</h3>
68 </div>
69 </div>
70 </div>
71 <div class="sect3" lang="en" xml:lang="en">
72 <div class="titlepage">
73 <div>
74 <div>
75 <h4 class="title"><a id="idp9117096"></a>flags</h4>
76 </div>
77 </div>
78 </div>
79 <p>
80 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
81 or by bitwise inclusively <span class="bold"><strong>OR</strong></span>'ing
82 together one or more of the following values:
83 </p>
84 <div class="itemizedlist">
85 <ul type="disc">
86 <li>
87 <p><a id="alloc_DB_MUTEX_PROCESS_ONLY"></a>
88 <code class="literal">DB_MUTEX_PROCESS_ONLY</code>
89 </p>
90 <p>
91 The mutex is associated with a single process. The
92 <a class="xref" href="envfailchk.html" title="DbEnv::failchk()">DbEnv::failchk()</a> method will
93 release mutexes held by any process which has exited.
94 </p>
95 </li>
96 <li>
97 <p><a id="alloc_DB_MUTEX_SELF_BLOCK"></a>
98 <code class="literal">DB_MUTEX_SELF_BLOCK</code>
99 </p>
100 <p>
101 The mutex must be self-blocking. That is, if a thread of control
102 locks the mutex and then attempts to lock the mutex again, the thread
103 of control will block until another thread of control releases the
104 original lock on the mutex, allowing the original thread of control to
105 lock the mutex the second time. Attempting to re-acquire a mutex for
106 which the <code class="literal">DB_MUTEX_SELF_BLOCK</code> flag was not specified will result in
107 undefined behavior.
108 </p>
109 </li>
110 </ul>
111 </div>
112 </div>
113 <div class="sect3" lang="en" xml:lang="en">
114 <div class="titlepage">
115 <div>
116 <div>
117 <h4 class="title"><a id="idp9136536"></a>mutexp</h4>
118 </div>
119 </div>
120 </div>
121 <p>
122 The <span class="bold"><strong>mutexp</strong></span> parameter references
123 memory into which the mutex reference is copied.
124 </p>
125 </div>
126 </div>
127 <div class="sect2" lang="en" xml:lang="en">
128 <div class="titlepage">
129 <div>
130 <div>
131 <h3 class="title"><a id="idp8583952"></a>Errors</h3>
132 </div>
133 </div>
134 </div>
135 <p>
136 The <code class="methodname">DbEnv::mutex_alloc()</code> <span>
137
138 <span>
139 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
140 exception, encapsulating one of the following non-zero errors, or return one
141 of the following non-zero errors:
142 </span>
143 </span>
144 </p>
145 <div class="sect3" lang="en" xml:lang="en">
146 <div class="titlepage">
147 <div>
148 <div>
149 <h4 class="title"><a id="idp9145096"></a>EINVAL</h4>
150 </div>
151 </div>
152 </div>
153 <p>
154 An invalid flag value or parameter was specified.
155 </p>
156 </div>
157 </div>
158 <div class="sect2" lang="en" xml:lang="en">
159 <div class="titlepage">
160 <div>
161 <div>
162 <h3 class="title"><a id="idp9143368"></a>Class</h3>
163 </div>
164 </div>
165 </div>
166 <p>
167 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
168 </p>
169 </div>
170 <div class="sect2" lang="en" xml:lang="en">
171 <div class="titlepage">
172 <div>
173 <div>
174 <h3 class="title"><a id="idp9140096"></a>See Also</h3>
175 </div>
176 </div>
177 </div>
178 <p>
179 <a class="xref" href="mutex.html#mutexlist" title="Mutex Methods">Mutex Methods</a>
180 </p>
181 </div>
182 </div>
183 <div class="navfooter">
184 <hr />
185 <table width="100%" summary="Navigation footer">
186 <tr>
187 <td width="40%" align="left"><a accesskey="p" href="mutex.html">Prev</a> </td>
188 <td width="20%" align="center">
189 <a accesskey="u" href="mutex.html">Up</a>
190 </td>
191 <td width="40%" align="right"> <a accesskey="n" href="mutexfree.html">Next</a></td>
192 </tr>
193 <tr>
194 <td width="40%" align="left" valign="top">Chapter 10. 
195 Mutex Methods
196  </td>
197 <td width="20%" align="center">
198 <a accesskey="h" href="index.html">Home</a>
199 </td>
200 <td width="40%" align="right" valign="top"> DbEnv::mutex_free()</td>
201 </tr>
202 </table>
203 </div>
204 </body>
205 </html>