]> git.saurik.com Git - apple/libpthread.git/blame_incremental - man/pthread_cancel.3
libpthread-330.250.2.tar.gz
[apple/libpthread.git] / man / pthread_cancel.3
... / ...
CommitLineData
1.\" $FreeBSD$
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
9.In pthread.h
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
46If successful, the
47.Fn pthread_cancel
48functions will return zero.
49Otherwise an error number will be returned to
50indicate the error.
51.Sh ERRORS
52The
53.Fn pthread_cancel
54function will fail if:
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
69The
70.Fn pthread_cancel
71function conforms to
72.St -p1003.1-96 .
73.Sh AUTHORS
74This manual page was written by
75.An David Leonard Aq Mt d@openbsd.org
76for the
77.Ox
78implementation of
79.Fn pthread_cancel .