blob: 723aa503db7b0756e810d293699e0710bdd6926b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
<table class="head">
<tr>
<td class="head-ltitle">PTHREAD_KEY_DELETE(3)</td>
<td class="head-vol">Library Functions Manual</td>
<td class="head-rtitle">PTHREAD_KEY_DELETE(3)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">pthread_key_delete</code> —
<span class="Nd">delete a thread-specific data key</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="LIBRARY"><a class="permalink" href="#LIBRARY">LIBRARY</a></h1>
<p class="Pp"><span class="Lb">POSIX Threads Library (libpthread,
-lpthread)</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
<<a class="In">pthread.h</a>></code></p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">pthread_key_delete</code>(<var class="Fa" style="white-space: nowrap;">pthread_key_t
key</var>);</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The
<a class="permalink" href="#pthread_key_delete"><code class="Fn" id="pthread_key_delete">pthread_key_delete</code></a>()
function deletes a thread-specific data key previously returned by
<a class="permalink" href="#pthread_key_create"><code class="Fn" id="pthread_key_create">pthread_key_create</code></a>().
The thread-specific data values associated with <var class="Fa">key</var>
need not be NULL at the time that
<code class="Fn">pthread_key_delete</code>() is called. It is the
responsibility of the application to free any application storage or perform
any cleanup actions for data structures related to the deleted key or
associated thread-specific data in any threads; this cleanup can be done
either before or after <code class="Fn">pthread_key_delete</code>() is
called. Any attempt to use <var class="Fa">key</var> following the call to
<code class="Fn">pthread_key_delete</code>() results in undefined
behavior.</p>
<p class="Pp" id="pthread_key_delete~2">The
<a class="permalink" href="#pthread_key_delete~2"><code class="Fn">pthread_key_delete</code></a>()
function is callable from within destructor functions. Destructor functions
are not invoked by <code class="Fn">pthread_key_delete</code>(). Any
destructor function that may have been associated with
<var class="Fa">key</var> will no longer be called upon thread exit.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
VALUES</a></h1>
<p class="Pp">If successful, the <code class="Fn">pthread_key_delete</code>()
function will return zero. Otherwise an error number will be returned to
indicate the error.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="ERRORS"><a class="permalink" href="#ERRORS">ERRORS</a></h1>
<p class="Pp">The <code class="Fn">pthread_key_delete</code>() function will
fail if:</p>
<dl class="Bl-tag">
<dt id="EINVAL">[<a class="permalink" href="#EINVAL"><code class="Er">EINVAL</code></a>]</dt>
<dd>The <var class="Fa">key</var> value is invalid.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr">pthread_getspecific(3)</a>,
<a class="Xr">pthread_key_create(3)</a>,
<a class="Xr">pthread_setspecific(3)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
<p class="Pp">The <code class="Fn">pthread_key_delete</code>() function conforms
to <span class="St">ISO/IEC 9945-1:1996
(“POSIX.1”)</span>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">April 4, 1996</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|