xref: /freebsd/share/man/man3/pthread_key_delete.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
10f7d6847SJulian Elischer.\" Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>.
20f7d6847SJulian Elischer.\" All rights reserved.
30f7d6847SJulian Elischer.\"
40f7d6847SJulian Elischer.\" Redistribution and use in source and binary forms, with or without
50f7d6847SJulian Elischer.\" modification, are permitted provided that the following conditions
60f7d6847SJulian Elischer.\" are met:
70f7d6847SJulian Elischer.\" 1. Redistributions of source code must retain the above copyright
80f7d6847SJulian Elischer.\"    notice, this list of conditions and the following disclaimer.
90f7d6847SJulian Elischer.\" 2. Redistributions in binary form must reproduce the above copyright
100f7d6847SJulian Elischer.\"    notice, this list of conditions and the following disclaimer in the
110f7d6847SJulian Elischer.\"    documentation and/or other materials provided with the distribution.
120f7d6847SJulian Elischer.\" 3. All advertising materials mentioning features or use of this software
130f7d6847SJulian Elischer.\"    must display the following acknowledgement:
140f7d6847SJulian Elischer.\"	This product includes software developed by John Birrell.
150f7d6847SJulian Elischer.\" 4. Neither the name of the author nor the names of any co-contributors
160f7d6847SJulian Elischer.\"    may be used to endorse or promote products derived from this software
170f7d6847SJulian Elischer.\"    without specific prior written permission.
180f7d6847SJulian Elischer.\"
190f7d6847SJulian Elischer.\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
200f7d6847SJulian Elischer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
210f7d6847SJulian Elischer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
220f7d6847SJulian Elischer.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
230f7d6847SJulian Elischer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
240f7d6847SJulian Elischer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
250f7d6847SJulian Elischer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
260f7d6847SJulian Elischer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
270f7d6847SJulian Elischer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
280f7d6847SJulian Elischer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
290f7d6847SJulian Elischer.\" SUCH DAMAGE.
300f7d6847SJulian Elischer.\"
310f7d6847SJulian Elischer.Dd April 4, 1996
320f7d6847SJulian Elischer.Dt PTHREAD_KEY_DELETE 3
33a307d598SRuslan Ermilov.Os
340f7d6847SJulian Elischer.Sh NAME
350f7d6847SJulian Elischer.Nm pthread_key_delete
360f7d6847SJulian Elischer.Nd delete a thread-specific data key
37d8a78688SAlexey Zelkin.Sh LIBRARY
38ec7452f1SRuslan Ermilov.Lb libpthread
390f7d6847SJulian Elischer.Sh SYNOPSIS
4032eef9aeSRuslan Ermilov.In pthread.h
410f7d6847SJulian Elischer.Ft int
420f7d6847SJulian Elischer.Fn pthread_key_delete "pthread_key_t key"
430f7d6847SJulian Elischer.Sh DESCRIPTION
440f7d6847SJulian ElischerThe
450f7d6847SJulian Elischer.Fn pthread_key_delete
460f7d6847SJulian Elischerfunction deletes a thread-specific data key previously returned by
470f7d6847SJulian Elischer.Fn pthread_key_create .
480f7d6847SJulian ElischerThe thread-specific data values associated with
490f7d6847SJulian Elischer.Fa key
500f7d6847SJulian Elischerneed not be NULL at the time that
510f7d6847SJulian Elischer.Fn pthread_key_delete
52c6ff3a1bSSheldon Hearnis called.
53c6ff3a1bSSheldon HearnIt is the responsibility of the application to free any
540f7d6847SJulian Elischerapplication storage or perform any cleanup actions for data structures
550f7d6847SJulian Elischerrelated to the deleted key or associated thread-specific data in any threads;
560f7d6847SJulian Elischerthis cleanup can be done either before or after
570f7d6847SJulian Elischer.Fn pthread_key_delete
58c6ff3a1bSSheldon Hearnis called.
59c6ff3a1bSSheldon HearnAny attempt to use
600f7d6847SJulian Elischer.Fa key
610f7d6847SJulian Elischerfollowing the call to
620f7d6847SJulian Elischer.Fn pthread_key_delete
630f7d6847SJulian Elischerresults in undefined behavior.
640f7d6847SJulian Elischer.Pp
650f7d6847SJulian ElischerThe
660f7d6847SJulian Elischer.Fn pthread_key_delete
67c6ff3a1bSSheldon Hearnfunction is callable from within destructor functions.
68c6ff3a1bSSheldon HearnDestructor functions
690f7d6847SJulian Elischerare not invoked by
700f7d6847SJulian Elischer.Fn pthread_key_delete .
710f7d6847SJulian ElischerAny destructor function that may have been associated with
720f7d6847SJulian Elischer.Fa key
730f7d6847SJulian Elischerwill no longer be called upon thread exit.
740f7d6847SJulian Elischer.Sh RETURN VALUES
750f7d6847SJulian ElischerIf successful, the
760f7d6847SJulian Elischer.Fn pthread_key_delete
77c6ff3a1bSSheldon Hearnfunction will return zero.
78c6ff3a1bSSheldon HearnOtherwise an error number will be returned to
790f7d6847SJulian Elischerindicate the error.
800f7d6847SJulian Elischer.Sh ERRORS
819d09157aSPhilippe CharnierThe
820f7d6847SJulian Elischer.Fn pthread_key_delete
839d09157aSPhilippe Charnierfunction will fail if:
840f7d6847SJulian Elischer.Bl -tag -width Er
850f7d6847SJulian Elischer.It Bq Er EINVAL
860f7d6847SJulian ElischerThe
870f7d6847SJulian Elischer.Fa key
880f7d6847SJulian Elischervalue is invalid.
890f7d6847SJulian Elischer.El
900f7d6847SJulian Elischer.Sh SEE ALSO
910f7d6847SJulian Elischer.Xr pthread_getspecific 3 ,
9275141cc9SWolfram Schneider.Xr pthread_key_create 3 ,
930f7d6847SJulian Elischer.Xr pthread_setspecific 3
940f7d6847SJulian Elischer.Sh STANDARDS
959d09157aSPhilippe CharnierThe
960f7d6847SJulian Elischer.Fn pthread_key_delete
979d09157aSPhilippe Charnierfunction conforms to
98096841ecSRuslan Ermilov.St -p1003.1-96 .
99