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