• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/db-4.8.30/docs/api_reference/CXX/
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_thread_id_string()</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_thread_id.html" title="DbEnv::set_thread_id()" />
12    <link rel="next" href="envset_timeout.html" title="DbEnv::set_timeout()" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">DbEnv::set_thread_id_string()</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="envset_thread_id.html">Prev</a> </td>
22          <th width="60%" align="center">Chapter 5. 
23                The DbEnv Handle
24        </th>
25          <td width="20%" align="right"> <a accesskey="n" href="envset_timeout.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_thread_id_string"></a>DbEnv::set_thread_id_string()</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">#include &lt;db_cxx&gt;
39
40int
41DbEnv::set_thread_id(void (*thread_id)
42                     (DbEnv *dbenv, pid_t *pid, db_threadid_t *tid)); </pre>
43      <p>
44         Declare a function that formats a process ID and thread ID identifier
45         pair for display into a caller-supplied buffer.  The function must
46         return a reference to the caller-specified buffer.  The
47         <code class="methodname">DbEnv::set_thread_id_string()</code> method supports the 
48         <a class="xref" href="envset_thread_id.html" title="DbEnv::set_thread_id()">DbEnv::set_thread_id()</a> 
49         method.
50    </p>
51      <p>
52         The <code class="methodname">DbEnv::set_thread_id_string()</code> method configures operations
53         performed using the specified <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>  
54         handle, not all operations performed on the underlying database environment.
55    </p>
56      <p>
57         The <code class="methodname">DbEnv::set_thread_id_string()</code> method may be called at any time
58         during the life of the application.
59    </p>
60      <p>
61         The <code class="methodname">DbEnv::set_thread_id_string()</code> <span>
62            
63            <span>
64                method either returns a non-zero error value or throws an
65                exception that encapsulates a non-zero error value on
66                failure, and returns 0 on success.
67            </span>
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="id1675408"></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="id1675413"></a>thread_id_string</h4>
83              </div>
84            </div>
85          </div>
86          <p>
87                          The <span class="bold"><strong>thread_id_string</strong></span> parameter is a
88                          function which returns a buffer in which is an identifier pair
89                          formatted for display.  The function takes four arguments:
90                     </p>
91          <div class="itemizedlist">
92            <ul type="disc">
93              <li>
94                <p>
95                                             <code class="literal">dbenv</code>
96                                     </p>
97                <p>
98                                        The <span class="bold"><strong>dbenv</strong></span> parameter is the enclosing database
99                                        environment handle, allowing application access to the application-private
100                                        fields of that object.
101                                    </p>
102              </li>
103              <li>
104                <p>
105                                             <code class="literal">pid</code>
106                                     </p>
107                <p>
108                                        The <span class="bold"><strong>pid</strong></span> argument is a process ID.
109                                     </p>
110              </li>
111              <li>
112                <p>
113                                             <code class="literal">tid</code>
114                                     </p>
115                <p>
116                                        The <span class="bold"><strong>tid</strong></span> argument is a thread ID.
117                                     </p>
118              </li>
119              <li>
120                <p>
121                                             <code class="literal">buf</code>
122                                     </p>
123                <p>
124                                        The <span class="bold"><strong>buf</strong></span> argument is character array of at least
125                                        DB_THREADID_STRLEN bytes in length, into which the identifier pair should be
126                                        formatted.
127                                     </p>
128              </li>
129            </ul>
130          </div>
131          <p>
132                             If no <span class="bold"><strong>thread_id_string</strong></span> function is specified, the default
133                             routine displays the identifier pair as "pid/tid", that is, the process ID represented as
134                             an unsigned integer value, a slash ('/') character, then the thread ID represented as an
135                             unsigned integer value.
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="id1675695"></a>Errors</h3>
144            </div>
145          </div>
146        </div>
147        <p>
148                         The <code class="methodname">DbEnv::set_thread_id_string()</code> <span>
149            
150            <span>
151                method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 
152                exception, encapsulating one of the following non-zero errors, or return one
153                of the following non-zero errors:
154            </span>
155        </span>
156                    </p>
157        <div class="sect3" lang="en" xml:lang="en">
158          <div class="titlepage">
159            <div>
160              <div>
161                <h4 class="title"><a id="id1675617"></a>EINVAL</h4>
162              </div>
163            </div>
164          </div>
165          <p>
166                An invalid flag value or parameter was specified.
167            </p>
168        </div>
169      </div>
170      <div class="sect2" lang="en" xml:lang="en">
171        <div class="titlepage">
172          <div>
173            <div>
174              <h3 class="title"><a id="id1675659"></a>Class</h3>
175            </div>
176          </div>
177        </div>
178        <p>
179                <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>  
180            </p>
181      </div>
182      <div class="sect2" lang="en" xml:lang="en">
183        <div class="titlepage">
184          <div>
185            <div>
186              <h3 class="title"><a id="id1675429"></a>See Also</h3>
187            </div>
188          </div>
189        </div>
190        <p>
191                     <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> 
192                </p>
193      </div>
194    </div>
195    <div class="navfooter">
196      <hr />
197      <table width="100%" summary="Navigation footer">
198        <tr>
199          <td width="40%" align="left"><a accesskey="p" href="envset_thread_id.html">Prev</a> </td>
200          <td width="20%" align="center">
201            <a accesskey="u" href="env.html">Up</a>
202          </td>
203          <td width="40%" align="right"> <a accesskey="n" href="envset_timeout.html">Next</a></td>
204        </tr>
205        <tr>
206          <td width="40%" align="left" valign="top">DbEnv::set_thread_id() </td>
207          <td width="20%" align="center">
208            <a accesskey="h" href="index.html">Home</a>
209          </td>
210          <td width="40%" align="right" valign="top"> DbEnv::set_timeout()</td>
211        </tr>
212      </table>
213    </div>
214  </body>
215</html>
216