Debian Codegraph @

docs/api_reference/C/mutexset_init.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>DB_ENV-&gt;mutex_set_init()</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 9.  Mutex Methods" />
11 <link rel="prev" href="mutexset_increment.html" title="DB_ENV-&gt;mutex_set_increment()" />
12 <link rel="next" href="mutexset_max.html" title="DB_ENV-&gt;mutex_set_max()" />
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">DB_ENV-&gt;mutex_set_init()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="mutexset_increment.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 9. 
26 Mutex Methods
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="mutexset_max.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="mutexset_init"></a>DB_ENV-&gt;mutex_set_init()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;mutex_set_init(DB_ENV *dbenv, u_int32_t init); </pre>
45 <p>
46 Configure the inital number of mutexes to allocate.
47 </p>
48 <p>
49 Berkeley DB allocates a default number of mutexes based on the
50 initial configuration of the database environment. The
51 <code class="methodname">DB_ENV-&gt;mutex_set_init()</code> method is used to
52 override this default number of mutexes to allocate. This may be done
53 to either speed up startup, or to force more work to be done at
54 startup to avoid later contention due to allocation.
55 </p>
56 <p>
57 The database environment's inital number of mutexes may also be
58 configured using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The syntax
59 of the entry in that file is a single line with the string
60 "mutex_set_init", one or more whitespace characters, and the
61 initial number of mutexes. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read
62 when the database environment is opened, it will silently overrule
63 configuration done before that time.
64 </p>
65 <p>
66 The <code class="methodname">DB_ENV-&gt;mutex_set_init()</code> method
67 configures a database environment, not only operations performed
68 using the specified <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
69 handle.
70 </p>
71 <p>
72 The <code class="methodname">DB_ENV-&gt;mutex_set_init()</code> method may not
73 be called after the
74 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> method is
75 called. If the database environment already exists when
76 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> is called, the
77 information specified to
78 <code class="methodname">DB_ENV-&gt;mutex_set_init()</code> will be ignored.
79 </p>
80 <p>
81 The <code class="methodname">DB_ENV-&gt;mutex_set_init()</code> <span>
82 <span>
83 method returns a non-zero error value on failure and 0 on success.
84 </span>
85
86 </span>
87 </p>
88 <div class="sect2" lang="en" xml:lang="en">
89 <div class="titlepage">
90 <div>
91 <div>
92 <h3 class="title"><a id="idp53749888"></a>Parameters</h3>
93 </div>
94 </div>
95 </div>
96 <div class="sect3" lang="en" xml:lang="en">
97 <div class="titlepage">
98 <div>
99 <div>
100 <h4 class="title"><a id="idp53735792"></a>init</h4>
101 </div>
102 </div>
103 </div>
104 <p>
105 The <span class="bold"><strong>init</strong></span> parameter is the absolute
106 number of mutexes to allocate.
107 </p>
108 </div>
109 </div>
110 <div class="sect2" lang="en" xml:lang="en">
111 <div class="titlepage">
112 <div>
113 <div>
114 <h3 class="title"><a id="idp53743776"></a>Errors</h3>
115 </div>
116 </div>
117 </div>
118 <p>
119 The <code class="methodname">DB_ENV-&gt;mutex_set_init()</code> <span>
120 <span>
121 method may fail and return one of the following non-zero errors:
122 </span>
123
124 </span>
125 </p>
126 <div class="sect3" lang="en" xml:lang="en">
127 <div class="titlepage">
128 <div>
129 <div>
130 <h4 class="title"><a id="idp53770744"></a>EINVAL</h4>
131 </div>
132 </div>
133 </div>
134 <p>
135 An invalid flag value or parameter was specified.
136 </p>
137 </div>
138 </div>
139 <div class="sect2" lang="en" xml:lang="en">
140 <div class="titlepage">
141 <div>
142 <div>
143 <h3 class="title"><a id="idp53769664"></a>Class</h3>
144 </div>
145 </div>
146 </div>
147 <p>
148 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
149 </p>
150 </div>
151 <div class="sect2" lang="en" xml:lang="en">
152 <div class="titlepage">
153 <div>
154 <div>
155 <h3 class="title"><a id="idp53748336"></a>See Also</h3>
156 </div>
157 </div>
158 </div>
159 <p>
160 <a class="xref" href="mutex.html#mutexlist" title="Mutex Methods">Mutex Methods</a>
161 </p>
162 </div>
163 </div>
164 <div class="navfooter">
165 <hr />
166 <table width="100%" summary="Navigation footer">
167 <tr>
168 <td width="40%" align="left"><a accesskey="p" href="mutexset_increment.html">Prev</a> </td>
169 <td width="20%" align="center">
170 <a accesskey="u" href="mutex.html">Up</a>
171 </td>
172 <td width="40%" align="right"> <a accesskey="n" href="mutexset_max.html">Next</a></td>
173 </tr>
174 <tr>
175 <td width="40%" align="left" valign="top">DB_ENV-&gt;mutex_set_increment() </td>
176 <td width="20%" align="center">
177 <a accesskey="h" href="index.html">Home</a>
178 </td>
179 <td width="40%" align="right" valign="top"> DB_ENV-&gt;mutex_set_max()</td>
180 </tr>
181 </table>
182 </div>
183 </body>
184 </html>