1<!--$Id: env_set_isalive.so,v 10.4 2006/01/27 16:13:48 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB: DbEnv::set_isalive</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td>
13<b>DbEnv::set_isalive</b>
14</td>
15<td align=right>
16<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a>
17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
18</tr></table>
19<hr size=1 noshade>
20<tt>
21<b><pre>
22#include &lt;db_cxx.h&gt;
23<p>
24int
25DbEnv::set_isalive(int (*is_alive)(DbEnv *dbenv, pid_t pid, db_threadid_t tid, u_int32_t flags));
26</pre></b>
27<hr size=1 noshade>
28<b>Description: DbEnv::set_isalive</b>
29<p>Declare a function that returns if a thread of control (either a true
30thread or a process) is still running.  The DbEnv::set_isalive method
31supports the <a href="../api_cxx/env_failchk.html">DbEnv::failchk</a> method.  For more information, see
32<a href="../ref/cam/app.html">Architecting Data Store and Concurrent
33Data Store applications</a>, and <a href="../ref/transapp/app.html">Architecting Transactional Data Store applications</a>.</p>
34<p>The DbEnv::set_isalive method configures operations performed using the specified
35<a href="../api_cxx/env_class.html">DbEnv</a> handle, not all operations performed on the underlying
36database environment.</p>
37<p>The DbEnv::set_isalive method may be called at any time during the life of the
38application.</p>
39<p>The DbEnv::set_isalive method
40either returns a non-zero error value
41or throws an exception that encapsulates a non-zero error value on
42failure, and returns 0 on success.
43</p>
44<b>Parameters</b> <br>
45 <b>is_alive</b><ul compact><li>The <b>is_alive</b> parameter is a function which returns non-zero if
46the thread of control, identified by the <b>pid</b> and <b>tid</b>
47arguments, is still running.  The function takes four arguments:</ul>
48<br>
49<b><b>dbenv</b></b><ul compact><li>The <b>dbenv</b> parameter is the enclosing database environment
50handle, allowing application access to the application-private fields
51of that object.</ul>
52<b><b>pid</b></b><ul compact><li>The <b>pid</b> parameter is a process ID returned by the function
53specified to the <a href="../api_cxx/env_set_thread_id.html">DbEnv::set_thread_id</a> method.</ul>
54<b><b>tid</b></b><ul compact><li>The <b>tid</b> parameter is a thread ID returned by the function
55specified to the <a href="../api_cxx/env_set_thread_id.html">DbEnv::set_thread_id</a> method.</ul>
56<b><b>flags</b></b><ul compact><li>The <b>flags</b> parameter must be set to 0 or
57the following value:
58<br>
59<b><a name="DB_MUTEX_PROCESS_ONLY">DB_MUTEX_PROCESS_ONLY</a></b><ul compact><li>Return only if the process is alive, the thread ID should be ignored.</ul>
60<br></ul>
61<br>
62<br>
63<br><b>Errors</b>
64<p>The DbEnv::set_isalive method
65may fail and throw
66<a href="../api_cxx/except_class.html">DbException</a>,
67encapsulating one of the following non-zero errors, or return one of
68the following non-zero errors:</p>
69<br>
70<b>EINVAL</b><ul compact><li>An
71invalid flag value or parameter was specified.</ul>
72<br>
73<hr size=1 noshade>
74<br><b>Class</b>
75<a href="../api_cxx/env_class.html">DbEnv</a>
76<br><b>See Also</b>
77<a href="../api_cxx/env_list.html">Database Environments and Related Methods</a>
78</tt>
79<table width="100%"><tr><td><br></td><td align=right>
80<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
81</td></tr></table>
82<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
83</body>
84</html>
85