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