7 .Nd cancel execution of a thread
15 .Fn pthread_cancel "pthread_t thread"
19 function requests that
22 The target thread's cancelability state and type determines
23 when the cancellation takes effect.
24 When the cancellation is acted on,
25 the cancellation cleanup handlers for
28 When the last cancellation cleanup handler returns,
29 the thread-specific data destructor functions will be called for
31 When the last destructor function returns,
35 The cancellation processing in the target thread runs asynchronously with
36 respect to the calling thread returning from
41 is made available to any threads joining with the target.
45 expands to a constant expression of type
47 whose value matches no pointer to an object in memory nor the value
52 functions will return zero.
53 Otherwise an error number will be returned to
58 function will fail if:
61 No thread could be found corresponding to that specified by the given
65 .Xr pthread_cleanup_pop 3 ,
66 .Xr pthread_cleanup_push 3 ,
69 .Xr pthread_setcancelstate 3 ,
70 .Xr pthread_setcanceltype 3 ,
71 .Xr pthread_testcancel 3
78 This manual page was written by
79 .An David Leonard Aq d@openbsd.org