7 .Nd cancel execution of a thread
9 .Fd #include <pthread.h>
11 .Fn pthread_cancel "pthread_t thread"
15 function requests that
17 be canceled. The target thread's cancelability state and type determines
18 when the cancellation takes effect. When the cancellation is acted on,
19 the cancellation cleanup handlers for
21 are called. When the last cancellation cleanup handler returns,
22 the thread-specific data destructor functions will be called for
24 When the last destructor function returns,
28 The cancellation processing in the target thread runs asynchronously with
29 respect to the calling thread returning from
34 is made available to any threads joining with the target. The symbolic
37 expands to a constant expression of type
39 whose value matches no pointer to an object in memory nor the value
44 functions will return zero. Otherwise an error number will be returned to
51 No thread could be found corresponding to that specified by the given
55 .Xr pthread_cleanup_pop 3 ,
56 .Xr pthread_cleanup_push 3 ,
59 .Xr pthread_setcancelstate 3 ,
60 .Xr pthread_setcanceltype 3 ,
61 .Xr pthread_testcancel 3
64 conforms to ISO/IEC 9945-1 ANSI/IEEE
66 Std 1003.1 Second Edition 1996-07-12.
68 This man page was written by
69 .An David Leonard <d@openbsd.org>
70 for the OpenBSD implementation of pthread_cancel.