diff options
Diffstat (limited to 'usr/src/man/man3c/tss.3c')
-rw-r--r-- | usr/src/man/man3c/tss.3c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/usr/src/man/man3c/tss.3c b/usr/src/man/man3c/tss.3c index 6e4b696339..9f8fde3912 100644 --- a/usr/src/man/man3c/tss.3c +++ b/usr/src/man/man3c/tss.3c @@ -50,20 +50,21 @@ storage. .Ss Creating and Destorying Thread-Specific Storage The .Fn tss_create -function creates a new thread-specific data key. The key space is opaque -and global to all threads in the process. Each thread has its own -value-space which can be manipulated with the +function creates a new thread-specific data key. +The key space is opaque and global to all threads in the process. +Each thread has its own value-space which can be manipulated with the .Fn tss_get and .Fn tss_set -functions. A given key persists until +functions. +A given key persists until .Fn tss_destroy is called. .Pp When a key is created, the value .Dv NULL -is associated with all current threads. When a thread is created, the -value +is associated with all current threads. +When a thread is created, the value .Dv NULL is assigned as the value for the entire key-space. .Pp @@ -75,20 +76,22 @@ will run when the thread exits (see .Xr thrd_exit 3C ) if the value for the key is not .Dv NULL . -The key space's destructors may be run in any order. When the destructor -is run due to a thread exiting, all signals will be blocked. +The key space's destructors may be run in any order. +When the destructor is run due to a thread exiting, all signals will be blocked. .Pp The .Fn tss_delete function deletes the key identify by .Fa key -from the global name-space. When a key is deleted, no registered -destructor is called, it is up to the calling program to free any -storage that was associated with +from the global name-space. +When a key is deleted, no registered destructor is called, it is up to the +calling program to free any storage that was associated with .Fa key -across all threads. Because of this propety, it is legal to call +across all threads. +Because of this propety, it is legal to call .Fn tss_delete -from inside a destructor. Any destructors that had been assocaited with +from inside a destructor. +Any destructors that had been assocaited with .Fa key will no longer be called when a thread terminates. .Ss Obtaining Values @@ -96,8 +99,9 @@ The .Fn tss_get function may be used to obtain the value associated with .Fa key -for the calling thread. Note that if the calling thread has never set a -value, then it will receive the default value, +for the calling thread. +Note that if the calling thread has never set a value, then it will receive the +default value, .Dv NULL . .Fn tss_get may be called from a tss destructor. @@ -116,7 +120,8 @@ in as .Fa value . Changing the value of a key with .Fn tss_set -does not cause any destructors to be invoked. This means that +does not cause any destructors to be invoked. +This means that .Fn tss_set may be used in the context of a destructor, but special care must be taken to avoid leaking storage or causing an infinite loop. |