pthread_cancel.3 (ded8c91a78d29be1249c792d1710b0ab43979b85) | pthread_cancel.3 (c6ff3a1bf74d96278726113478b2c66884aab584) |
---|---|
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.Fd #include <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 | 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.Fd #include <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. The target thread's cancelability state and type determines 18when the cancellation takes effect. When the cancellation is acted on, | 17be canceled. 18The target thread's cancelability state and type determines 19when the cancellation takes effect. 20When the cancellation is acted on, |
19the cancellation cleanup handlers for 20.Fa thread | 21the cancellation cleanup handlers for 22.Fa thread |
21are called. When the last cancellation cleanup handler returns, | 23are called. 24When the last cancellation cleanup handler returns, |
22the thread-specific data destructor functions will be called for 23.Fa thread . 24When the last destructor function returns, 25.Fa thread 26will be terminated. 27.Pp 28The cancellation processing in the target thread runs asynchronously with 29respect to the calling thread returning from 30.Fn pthread_cancel . 31.Pp 32A status of 33.Dv PTHREAD_CANCELED | 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 |
34is made available to any threads joining with the target. The symbolic | 37is made available to any threads joining with the target. 38The symbolic |
35constant 36.Dv PTHREAD_CANCELED 37expands to a constant expression of type 38.Ft "(void *)" , 39whose value matches no pointer to an object in memory nor the value 40.Dv NULL . 41.Sh RETURN VALUES 42If successful, the 43.Fn pthread_cancel | 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 |
44functions will return zero. Otherwise an error number will be returned to | 48functions will return zero. 49Otherwise an error number will be returned to |
45indicate the error. 46.Sh ERRORS 47.Fn pthread_cancel 48will fail if: 49.Bl -tag -width Er 50.It Bq Er ESRCH 51No thread could be found corresponding to that specified by the given 52thread ID. --- 21 unchanged lines hidden --- | 50indicate the error. 51.Sh ERRORS 52.Fn pthread_cancel 53will fail if: 54.Bl -tag -width Er 55.It Bq Er ESRCH 56No thread could be found corresponding to that specified by the given 57thread ID. --- 21 unchanged lines hidden --- |