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