pci.9: Sync with FreeBSD.
[dragonfly.git] / lib / libpthread / pthread_cancel.3
CommitLineData
984263bc 1.\" $FreeBSD: src/lib/libc_r/man/pthread_cancel.3,v 1.3.2.4 2001/12/17 10:08:26 ru Exp $
1de703da 2.\" $DragonFly: src/lib/libc_r/man/pthread_cancel.3,v 1.2 2003/06/17 04:26:47 dillon Exp $
9964d5ef 3.Dd April 15, 2009
984263bc
MD
4.Dt PTHREAD_CANCEL 3
5.Os
6.Sh NAME
7.Nm pthread_cancel
8.Nd cancel execution of a thread
9.Sh LIBRARY
9964d5ef 10.Lb libpthread
984263bc
MD
11.Sh SYNOPSIS
12.In pthread.h
13.Ft int
14.Fn pthread_cancel "pthread_t thread"
15.Sh DESCRIPTION
16The
17.Fn pthread_cancel
18function requests that
19.Fa thread
20be canceled.
21The target thread's cancelability state and type determines
22when the cancellation takes effect.
23When the cancellation is acted on,
24the cancellation cleanup handlers for
25.Fa thread
26are called.
27When the last cancellation cleanup handler returns,
28the thread-specific data destructor functions will be called for
29.Fa thread .
30When the last destructor function returns,
31.Fa thread
32will be terminated.
33.Pp
34The cancellation processing in the target thread runs asynchronously with
35respect to the calling thread returning from
36.Fn pthread_cancel .
37.Pp
38A status of
39.Dv PTHREAD_CANCELED
40is made available to any threads joining with the target.
41The symbolic
42constant
43.Dv PTHREAD_CANCELED
44expands to a constant expression of type
45.Ft "(void *)" ,
46whose value matches no pointer to an object in memory nor the value
47.Dv NULL .
48.Sh RETURN VALUES
49If successful, the
50.Fn pthread_cancel
51functions will return zero.
52Otherwise an error number will be returned to
53indicate the error.
54.Sh ERRORS
55.Fn pthread_cancel
56will fail if:
57.Bl -tag -width Er
58.It Bq Er ESRCH
59No thread could be found corresponding to that specified by the given
60thread ID.
61.El
62.Sh SEE ALSO
63.Xr pthread_cleanup_pop 3 ,
64.Xr pthread_cleanup_push 3 ,
65.Xr pthread_exit 3 ,
66.Xr pthread_join 3 ,
67.Xr pthread_setcancelstate 3 ,
68.Xr pthread_setcanceltype 3 ,
69.Xr pthread_testcancel 3
70.Sh STANDARDS
71.Fn pthread_cancel
72conforms to
73.St -p1003.1-96 .
74.Sh AUTHORS
75This man page was written by
76.An David Leonard Aq d@openbsd.org
77for the
78.Ox
79implementation of
80.Fn pthread_cancel .