Print this page
11586 NAME field in man pages should match what's installed
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3c/tss.3c
+++ new/usr/src/man/man3c/tss.3c
1 1 .\"
2 2 .\" This file and its contents are supplied under the terms of the
3 3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
4 4 .\" You may only use this file in accordance with the terms of version
5 5 .\" 1.0 of the CDDL.
6 6 .\"
7 7 .\" A full copy of the text of the CDDL should have accompanied this
8 8 .\" source. A copy of the CDDL is also available via the Internet at
9 9 .\" http://www.illumos.org/license/CDDL.
10 10 .\"
11 11 .\"
12 12 .\" Copyright 2016 Joyent, Inc.
13 13 .\"
14 -.Dd "Jan 11, 2015"
14 +.Dd "Aug 20, 2019"
15 15 .Dt TSS 3C
16 16 .Os
17 17 .Sh NAME
18 18 .Nm tss ,
19 19 .Nm tss_create ,
20 -.Nm tss_destroy ,
20 +.Nm tss_delete ,
21 21 .Nm tss_get ,
22 22 .Nm tss_set
23 23 .Nd thread-specific storage
24 24 .Sh SYNOPSIS
25 25 .In threads.h
26 26 .Vt "typedef void (*tss_dtor_t)(void *);"
27 27 .Ft int
28 28 .Fo tss_create
29 29 .Fa "tss_t *key"
30 30 .Fa "tss_dtor_t dtor"
31 31 .Fc
32 32 .Ft void
33 33 .Fo tss_delete
34 34 .Fa "tss_t key"
35 35 .Fc
36 36 .Ft void *
37 37 .Fo tss_get
38 38 .Fa "tss_t key"
39 39 .Fc
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
40 40 .Ft int
41 41 .Fo tss_set
42 42 .Fa "tss_t key"
43 43 .Fa "void *val"
44 44 .Fc
45 45 .Sh DESCRIPTION
46 46 The
47 47 .Sy tss
48 48 family of functions create, get, set, and destroy thread-specific
49 49 storage.
50 -.Ss Creating and Destorying Thread-Specific Storage
50 +.Ss Creating and Destroying Thread-Specific Storage
51 51 The
52 52 .Fn tss_create
53 53 function creates a new thread-specific data key.
54 54 The key space is opaque and global to all threads in the process.
55 55 Each thread has its own value-space which can be manipulated with the
56 56 .Fn tss_get
57 57 and
58 58 .Fn tss_set
59 59 functions.
60 60 A given key persists until
61 -.Fn tss_destroy
61 +.Fn tss_delete
62 62 is called.
63 63 .Pp
64 64 When a key is created, the value
65 65 .Dv NULL
66 66 is associated with all current threads.
67 67 When a thread is created, the value
68 68 .Dv NULL
69 69 is assigned as the value for the entire key-space.
70 70 .Pp
71 71 A key may optionally be created with a destructor function
72 72 .Fa dtor .
73 73 The function
74 74 .Fa dtor
75 75 will run when the thread exits (see
76 76 .Xr thrd_exit 3C )
77 77 if the value for the key is not
78 78 .Dv NULL .
79 79 The key space's destructors may be run in any order.
80 80 When the destructor is run due to a thread exiting, all signals will be blocked.
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
81 81 .Pp
82 82 The
83 83 .Fn tss_delete
84 84 function deletes the key identify by
85 85 .Fa key
86 86 from the global name-space.
87 87 When a key is deleted, no registered destructor is called, it is up to the
88 88 calling program to free any storage that was associated with
89 89 .Fa key
90 90 across all threads.
91 -Because of this propety, it is legal to call
91 +Because of this property, it is legal to call
92 92 .Fn tss_delete
93 93 from inside a destructor.
94 -Any destructors that had been assocaited with
94 +Any destructors that had been associated with
95 95 .Fa key
96 96 will no longer be called when a thread terminates.
97 97 .Ss Obtaining Values
98 98 The
99 99 .Fn tss_get
100 100 function may be used to obtain the value associated with
101 101 .Fa key
102 102 for the calling thread.
103 103 Note that if the calling thread has never set a value, then it will receive the
104 104 default value,
105 105 .Dv NULL .
106 106 .Fn tss_get
107 107 may be called from a tss destructor.
108 108 .Ss Setting Values
109 109 The
110 110 .Fn tss_set
111 111 function sets the value of the key
112 112 .Fa key
113 -for the callling thread to
113 +for the calling thread to
114 114 .Fa value ,
115 115 which may be obtained by subsequent calls to
116 116 .Fa tss_get .
117 117 To remove a value for a specific thread, one may pass
118 118 .Dv NULL
119 119 in as
120 120 .Fa value .
121 121 Changing the value of a key with
122 122 .Fn tss_set
123 123 does not cause any destructors to be invoked.
124 124 This means that
125 125 .Fn tss_set
126 126 may be used in the context of a destructor, but special care must be
127 127 taken to avoid leaking storage or causing an infinite loop.
128 128 .Sh RETURN VALUES
129 129 Upon successful completion, the
130 130 .Fn tss_create
131 131 and
132 132 .Fn tss_set
133 133 functions return
134 134 .Sy thrd_success .
135 135 Otherwise, they return
136 136 .Sy thrd_error
137 137 to indicate that an error occurred.
138 138 .Pp
139 139 Upon successful completion, the
140 140 .Fn tss_get
141 141 function returns the thread-specific value associated with the given
142 142 .Fa key .
143 143 If no thread-specific value is associated with the key or an invalid key
144 144 was passed in, then
145 145 .Dv NULL
146 146 is returned.
147 147 .Sh INTERFACE STABILITY
148 148 .Sy Standard
149 149 .Sh MT-LEVEL
150 150 .Sy MT-Safe
151 151 .Sh SEE ALSO
152 152 .Xr pthread_getspecific 3C ,
153 153 .Xr pthread_key_create 3C ,
154 154 .Xr pthread_key_delete 3C ,
155 155 .Xr pthread_setspecific 3C ,
156 156 .Xr attributes 5
↓ open down ↓ |
33 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX