17285bccfSAlfred Perlstein.\" $FreeBSD$ 27285bccfSAlfred Perlstein.Dd January 17, 1999 37285bccfSAlfred Perlstein.Dt PTHREAD_CANCEL 3 47285bccfSAlfred Perlstein.Os 57285bccfSAlfred Perlstein.Sh NAME 67285bccfSAlfred Perlstein.Nm pthread_cancel 77285bccfSAlfred Perlstein.Nd cancel execution of a thread 8d8a78688SAlexey Zelkin.Sh LIBRARY 9d8a78688SAlexey Zelkin.Lb libc_r 10ec7452f1SRuslan Ermilov.Lb libpthread 117285bccfSAlfred Perlstein.Sh SYNOPSIS 1232eef9aeSRuslan Ermilov.In pthread.h 137285bccfSAlfred Perlstein.Ft int 147285bccfSAlfred Perlstein.Fn pthread_cancel "pthread_t thread" 157285bccfSAlfred Perlstein.Sh DESCRIPTION 167285bccfSAlfred PerlsteinThe 177285bccfSAlfred Perlstein.Fn pthread_cancel 187285bccfSAlfred Perlsteinfunction requests that 197285bccfSAlfred Perlstein.Fa thread 20c6ff3a1bSSheldon Hearnbe canceled. 21c6ff3a1bSSheldon HearnThe target thread's cancelability state and type determines 22c6ff3a1bSSheldon Hearnwhen the cancellation takes effect. 23c6ff3a1bSSheldon HearnWhen the cancellation is acted on, 247285bccfSAlfred Perlsteinthe cancellation cleanup handlers for 257285bccfSAlfred Perlstein.Fa thread 26c6ff3a1bSSheldon Hearnare called. 27c6ff3a1bSSheldon HearnWhen the last cancellation cleanup handler returns, 287285bccfSAlfred Perlsteinthe thread-specific data destructor functions will be called for 297285bccfSAlfred Perlstein.Fa thread . 307285bccfSAlfred PerlsteinWhen the last destructor function returns, 317285bccfSAlfred Perlstein.Fa thread 327285bccfSAlfred Perlsteinwill be terminated. 337285bccfSAlfred Perlstein.Pp 347285bccfSAlfred PerlsteinThe cancellation processing in the target thread runs asynchronously with 357285bccfSAlfred Perlsteinrespect to the calling thread returning from 367285bccfSAlfred Perlstein.Fn pthread_cancel . 377285bccfSAlfred Perlstein.Pp 387285bccfSAlfred PerlsteinA status of 397285bccfSAlfred Perlstein.Dv PTHREAD_CANCELED 40c6ff3a1bSSheldon Hearnis made available to any threads joining with the target. 41c6ff3a1bSSheldon HearnThe symbolic 427285bccfSAlfred Perlsteinconstant 437285bccfSAlfred Perlstein.Dv PTHREAD_CANCELED 447285bccfSAlfred Perlsteinexpands to a constant expression of type 457285bccfSAlfred Perlstein.Ft "(void *)" , 467285bccfSAlfred Perlsteinwhose value matches no pointer to an object in memory nor the value 477285bccfSAlfred Perlstein.Dv NULL . 487285bccfSAlfred Perlstein.Sh RETURN VALUES 497285bccfSAlfred PerlsteinIf successful, the 507285bccfSAlfred Perlstein.Fn pthread_cancel 51c6ff3a1bSSheldon Hearnfunctions will return zero. 52c6ff3a1bSSheldon HearnOtherwise an error number will be returned to 537285bccfSAlfred Perlsteinindicate the error. 547285bccfSAlfred Perlstein.Sh ERRORS 556f673fd1SPhilippe CharnierThe 567285bccfSAlfred Perlstein.Fn pthread_cancel 576f673fd1SPhilippe Charnierfunction will fail if: 587285bccfSAlfred Perlstein.Bl -tag -width Er 597285bccfSAlfred Perlstein.It Bq Er ESRCH 607285bccfSAlfred PerlsteinNo thread could be found corresponding to that specified by the given 617285bccfSAlfred Perlsteinthread ID. 627285bccfSAlfred Perlstein.El 637285bccfSAlfred Perlstein.Sh SEE ALSO 647285bccfSAlfred Perlstein.Xr pthread_cleanup_pop 3 , 657285bccfSAlfred Perlstein.Xr pthread_cleanup_push 3 , 667285bccfSAlfred Perlstein.Xr pthread_exit 3 , 677285bccfSAlfred Perlstein.Xr pthread_join 3 , 687285bccfSAlfred Perlstein.Xr pthread_setcancelstate 3 , 697285bccfSAlfred Perlstein.Xr pthread_setcanceltype 3 , 707285bccfSAlfred Perlstein.Xr pthread_testcancel 3 717285bccfSAlfred Perlstein.Sh STANDARDS 726f673fd1SPhilippe CharnierThe 737285bccfSAlfred Perlstein.Fn pthread_cancel 746f673fd1SPhilippe Charnierfunction conforms to 75096841ecSRuslan Ermilov.St -p1003.1-96 . 767285bccfSAlfred Perlstein.Sh AUTHORS 777285bccfSAlfred PerlsteinThis man page was written by 78ded8c91aSAlexey Zelkin.An David Leonard Aq d@openbsd.org 79ded8c91aSAlexey Zelkinfor the 80ded8c91aSAlexey Zelkin.Ox 81ded8c91aSAlexey Zelkinimplementation of 82ded8c91aSAlexey Zelkin.Fn pthread_cancel . 83