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: DB_ENV->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>DB_ENV->set_isalive</b> 14</td> 15<td align=right> 16<a href="/api_c/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 <db.h> 23<p> 24int 25DB_ENV->set_isalive(DB_ENV *dbenv, 26 int (*is_alive)(DB_ENV *dbenv, pid_t pid, db_threadid_t tid, u_int32_t flags)); 27</pre></b> 28<hr size=1 noshade> 29<b>Description: DB_ENV->set_isalive</b> 30<p>Declare a function that returns if a thread of control (either a true 31thread or a process) is still running. The DB_ENV->set_isalive method 32supports the <a href="/api_c/env_failchk.html">DB_ENV->failchk</a> method. For more information, see 33<a href="/ref/cam/app.html">Architecting Data Store and Concurrent 34Data Store applications</a>, and <a href="/ref/transapp/app.html">Architecting Transactional Data Store applications</a>.</p> 35<p>The DB_ENV->set_isalive method configures operations performed using the specified 36<a href="/api_c/env_class.html">DB_ENV</a> handle, not all operations performed on the underlying 37database environment.</p> 38<p>The DB_ENV->set_isalive method may be called at any time during the life of the 39application.</p> 40<p>The DB_ENV->set_isalive method 41returns a non-zero error value on failure 42and 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_c/env_set_thread_id.html">DB_ENV->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_c/env_set_thread_id.html">DB_ENV->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 DB_ENV->set_isalive method 65may fail and return one of the following non-zero errors:</p> 66<br> 67<b>EINVAL</b><ul compact><li>An 68invalid flag value or parameter was specified.</ul> 69<br> 70<hr size=1 noshade> 71<br><b>Class</b> 72<a href="/api_c/env_class.html">DB_ENV</a> 73<br><b>See Also</b> 74<a href="/api_c/env_list.html">Database Environments and Related Methods</a> 75</tt> 76<table width="100%"><tr><td><br></td><td align=right> 77<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 78</td></tr></table> 79<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 80</body> 81</html> 82