1951 leaking a vdev when removing an l2cache device
[unleashed.git] / usr / src / man / man3c / pthread_cancel.3c
blobda6f6b3bfd657eb8ad57e063541f66bccb2ae146
1 '\" te
2 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
4 .\" Copyright 1991, 1992, 1994, The X/Open Company Ltd.
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH PTHREAD_CANCEL 3C "Nov 2, 2007"
13 .SH NAME
14 pthread_cancel \- cancel execution of a thread
15 .SH SYNOPSIS
16 .LP
17 .nf
18 cc -mt [ \fIflag\fR... ] \fIfile\fR... -lpthread [ \fIlibrary\fR... ]
19 #include <pthread.h>
21 \fBint\fR \fBpthread_cancel\fR(\fBpthread_t\fR \fItarget_thread\fR);
22 .fi
24 .SH DESCRIPTION
25 .sp
26 .LP
27 The \fBpthread_cancel()\fR function requests that \fItarget_thread\fR be
28 canceled.
29 .sp
30 .LP
31 By default, cancellation is deferred until \fItarget_thread\fR reaches a
32 cancellation point. See \fBcancellation\fR(5).
33 .sp
34 .LP
35 Cancellation cleanup handlers for \fItarget_thread\fR are called when the
36 cancellation is acted on. Upon return of the last cancellation cleanup handler,
37 the thread-specific data destructor functions are called for
38 \fItarget_thread\fR. \fItarget_thread\fR is terminated when the last destructor
39 function returns.
40 .sp
41 .LP
42 A thread acting on a cancellation request runs with all signals blocked. All
43 thread termination functions, including cancellation cleanup handlers and
44 thread-specific data destructor functions, are called with all signals blocked.
45 .sp
46 .LP
47 The cancellation processing in  \fItarget_thread\fR runs asynchronously with
48 respect to the calling thread returning from \fBpthread_cancel()\fR.
49 .SH RETURN VALUES
50 .sp
51 .LP
52 If successful, the \fBpthread_cancel()\fR function returns  \fB0\fR. Otherwise,
53 an error number is returned to indicate the error.
54 .SH ERRORS
55 .sp
56 .LP
57 The  \fBpthread_cancel()\fR function may fail if:
58 .sp
59 .ne 2
60 .na
61 \fB\fBESRCH\fR\fR
62 .ad
63 .RS 9n
64 No thread was found with an \fBID\fR corresponding to that specified by the
65 given thread \fBID,\fR \fItarget_thread\fR.
66 .RE
68 .SH ATTRIBUTES
69 .sp
70 .LP
71 See \fBattributes\fR(5) for descriptions of the following attributes:
72 .sp
74 .sp
75 .TS
76 box;
77 c | c
78 l | l .
79 ATTRIBUTE TYPE  ATTRIBUTE VALUE
81 Interface Stability     Committed
83 MT-Level        MT-Safe
85 Standard        See \fBstandards\fR(5).
86 .TE
88 .SH SEE ALSO
89 .sp
90 .LP
91 \fBpthread_cleanup_pop\fR(3C), \fBpthread_cleanup_push\fR(3C),
92 \fBpthread_cond_wait\fR(3C), \fBpthread_cond_timedwait\fR(3C),
93 \fBpthread_exit\fR(3C), \fBpthread_join\fR(3C),
94 \fBpthread_setcancelstate\fR(3C), \fBpthread_setcanceltype\fR(3C),
95 \fBpthread_testcancel\fR(3C), \fBsetjmp\fR(3C), \fBattributes\fR(5),
96 \fBcancellation\fR(5), \fBcondition\fR(5), \fBstandards\fR(5)
97 .SH NOTES
98 .sp
99 .LP
100 See \fBcancellation\fR(5) for a discussion of cancellation concepts.