Debian Codegraph @

docs/api_reference/CXX/envset_isalive.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::set_isalive()</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="env.html" title="Chapter 5.  The DbEnv Handle" />
11 <link rel="prev" href="envset_intermediate_dir_mode.html" title="DbEnv::set_intermediate_dir_mode()" />
12 <link rel="next" href="envset_memory_init.html" title="DbEnv::set_memory_init()" />
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::set_isalive()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envset_intermediate_dir_mode.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 5. 
26 The DbEnv Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envset_memory_init.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="envset_isalive"></a>DbEnv::set_isalive()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::set_isalive(int (*is_alive)(DbEnv *dbenv, pid_t pid,
45 db_threadid_t tid, u_int32_t flags));</pre>
46 <p>
47 Declare a function that returns if a thread of control (either a true
48 thread or a process) is still running. The <code class="methodname">DbEnv::set_isalive()</code>
49 method supports the <a class="xref" href="envfailchk.html" title="DbEnv::failchk()">DbEnv::failchk()</a> method.
50 For more information, see
51 <a href="../../programmer_reference/cam_app.html" class="olink">Architecting Data Store and Concurrent
52 Data Store applications</a>, and
53 <a href="../../programmer_reference/transapp_app.html" class="olink">Architecting Transactional Data Store
54 applications</a>, both in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>.
55 </p>
56 <p>
57 The <code class="methodname">DbEnv::set_isalive()</code> method configures operations performed
58 using the specified <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> handle, not all
59 operations performed on the underlying database environment.
60 </p>
61 <p>
62 The <code class="methodname">DbEnv::set_isalive()</code> method may be called at any time during the
63 life of the application.
64 </p>
65 <p>
66 The <code class="methodname">DbEnv::set_isalive()</code> <span>
67
68 <span>
69 method either returns a non-zero error value or throws an
70 exception that encapsulates a non-zero error value on
71 failure, and returns 0 on success.
72 </span>
73 </span>
74 </p>
75 <div class="sect2" lang="en" xml:lang="en">
76 <div class="titlepage">
77 <div>
78 <div>
79 <h3 class="title"><a id="idp7484736"></a>Parameters</h3>
80 </div>
81 </div>
82 </div>
83 <div class="sect3" lang="en" xml:lang="en">
84 <div class="titlepage">
85 <div>
86 <div>
87 <h4 class="title"><a id="idp7484472"></a>is_alive</h4>
88 </div>
89 </div>
90 </div>
91 <p>
92 The <span class="bold"><strong>is_alive</strong></span> parameter is a function
93 which returns non-zero if the thread of control, identified by the
94 <span class="bold"><strong>pid</strong></span> and <span class="bold"><strong>tid</strong></span> arguments, is still running. The function
95 takes four arguments:
96 </p>
97 <div class="itemizedlist">
98 <ul type="disc">
99 <li>
100 <p>
101 <span class="bold"><strong>dbenv</strong></span>
102 </p>
103 <p>
104 The <span class="bold"><strong>dbenv</strong></span> parameter is the enclosing
105 database environment handle, allowing application access to the
106 application-private fields of that object.
107 </p>
108 </li>
109 <li>
110 <p>
111 <span class="bold"><strong>pid</strong></span>
112 </p>
113 <p>
114 The <span class="bold"><strong>pid</strong></span> parameter is a process ID
115 returned by the function specified to the
116 <a class="xref" href="envset_thread_id.html" title="DbEnv::set_thread_id()">DbEnv::set_thread_id()</a>
117 method.
118 </p>
119 </li>
120 <li>
121 <p>
122 <span class="bold"><strong>tid</strong></span>
123 </p>
124 <p>
125 The <span class="bold"><strong>tid</strong></span> parameter is a thread ID
126 returned by the function specified to the
127 <a class="xref" href="envset_thread_id.html" title="DbEnv::set_thread_id()">DbEnv::set_thread_id()</a>
128 method.
129 </p>
130 </li>
131 <li>
132 <p>
133 <span class="bold"><strong>flags</strong></span>
134 </p>
135 <p>
136 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
137 or the following value:
138 </p>
139 <div class="itemizedlist">
140 <ul type="circle">
141 <li>
142 <p><a id="isalive_DB_MUTEX_PROCESS_ONLY"></a>
143 <code class="literal">DB_MUTEX_PROCESS_ONLY</code>
144 </p>
145 <p>
146 Return only if the process is alive, the thread ID
147 should be ignored.
148 </p>
149 </li>
150 </ul>
151 </div>
152 </li>
153 </ul>
154 </div>
155 </div>
156 </div>
157 <div class="sect2" lang="en" xml:lang="en">
158 <div class="titlepage">
159 <div>
160 <div>
161 <h3 class="title"><a id="idp7503912"></a>Errors</h3>
162 </div>
163 </div>
164 </div>
165 <p>
166 The <code class="methodname">DbEnv::set_isalive()</code> <span>
167
168 <span>
169 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
170 exception, encapsulating one of the following non-zero errors, or return one
171 of the following non-zero errors:
172 </span>
173 </span>
174 </p>
175 <div class="sect3" lang="en" xml:lang="en">
176 <div class="titlepage">
177 <div>
178 <div>
179 <h4 class="title"><a id="idp7517976"></a>EINVAL</h4>
180 </div>
181 </div>
182 </div>
183 <p>
184 An invalid flag value or parameter was specified.
185 </p>
186 </div>
187 </div>
188 <div class="sect2" lang="en" xml:lang="en">
189 <div class="titlepage">
190 <div>
191 <div>
192 <h3 class="title"><a id="idp7519816"></a>Class</h3>
193 </div>
194 </div>
195 </div>
196 <p>
197 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
198 </p>
199 </div>
200 <div class="sect2" lang="en" xml:lang="en">
201 <div class="titlepage">
202 <div>
203 <div>
204 <h3 class="title"><a id="idp7515280"></a>See Also</h3>
205 </div>
206 </div>
207 </div>
208 <p>
209 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
210 </p>
211 </div>
212 </div>
213 <div class="navfooter">
214 <hr />
215 <table width="100%" summary="Navigation footer">
216 <tr>
217 <td width="40%" align="left"><a accesskey="p" href="envset_intermediate_dir_mode.html">Prev</a> </td>
218 <td width="20%" align="center">
219 <a accesskey="u" href="env.html">Up</a>
220 </td>
221 <td width="40%" align="right"> <a accesskey="n" href="envset_memory_init.html">Next</a></td>
222 </tr>
223 <tr>
224 <td width="40%" align="left" valign="top">DbEnv::set_intermediate_dir_mode() </td>
225 <td width="20%" align="center">
226 <a accesskey="h" href="index.html">Home</a>
227 </td>
228 <td width="40%" align="right" valign="top"> DbEnv::set_memory_init()</td>
229 </tr>
230 </table>
231 </div>
232 </body>
233 </html>