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 11f9f9d2e8SRuslan Ermilov.Lb libthr 127285bccfSAlfred Perlstein.Sh SYNOPSIS 1332eef9aeSRuslan Ermilov.In pthread.h 147285bccfSAlfred Perlstein.Ft int 157285bccfSAlfred Perlstein.Fn pthread_cancel "pthread_t thread" 167285bccfSAlfred Perlstein.Sh DESCRIPTION 177285bccfSAlfred PerlsteinThe 187285bccfSAlfred Perlstein.Fn pthread_cancel 197285bccfSAlfred Perlsteinfunction requests that 207285bccfSAlfred Perlstein.Fa thread 21c6ff3a1bSSheldon Hearnbe canceled. 22c6ff3a1bSSheldon HearnThe target thread's cancelability state and type determines 23c6ff3a1bSSheldon Hearnwhen the cancellation takes effect. 24c6ff3a1bSSheldon HearnWhen the cancellation is acted on, 257285bccfSAlfred Perlsteinthe cancellation cleanup handlers for 267285bccfSAlfred Perlstein.Fa thread 27c6ff3a1bSSheldon Hearnare called. 28c6ff3a1bSSheldon HearnWhen the last cancellation cleanup handler returns, 297285bccfSAlfred Perlsteinthe thread-specific data destructor functions will be called for 307285bccfSAlfred Perlstein.Fa thread . 317285bccfSAlfred PerlsteinWhen the last destructor function returns, 327285bccfSAlfred Perlstein.Fa thread 337285bccfSAlfred Perlsteinwill be terminated. 347285bccfSAlfred Perlstein.Pp 357285bccfSAlfred PerlsteinThe cancellation processing in the target thread runs asynchronously with 367285bccfSAlfred Perlsteinrespect to the calling thread returning from 377285bccfSAlfred Perlstein.Fn pthread_cancel . 387285bccfSAlfred Perlstein.Pp 397285bccfSAlfred PerlsteinA status of 407285bccfSAlfred Perlstein.Dv PTHREAD_CANCELED 41c6ff3a1bSSheldon Hearnis made available to any threads joining with the target. 42c6ff3a1bSSheldon HearnThe symbolic 437285bccfSAlfred Perlsteinconstant 447285bccfSAlfred Perlstein.Dv PTHREAD_CANCELED 457285bccfSAlfred Perlsteinexpands to a constant expression of type 467285bccfSAlfred Perlstein.Ft "(void *)" , 477285bccfSAlfred Perlsteinwhose value matches no pointer to an object in memory nor the value 487285bccfSAlfred Perlstein.Dv NULL . 497285bccfSAlfred Perlstein.Sh RETURN VALUES 507285bccfSAlfred PerlsteinIf successful, the 517285bccfSAlfred Perlstein.Fn pthread_cancel 52c6ff3a1bSSheldon Hearnfunctions will return zero. 53c6ff3a1bSSheldon HearnOtherwise an error number will be returned to 547285bccfSAlfred Perlsteinindicate the error. 557285bccfSAlfred Perlstein.Sh ERRORS 566f673fd1SPhilippe CharnierThe 577285bccfSAlfred Perlstein.Fn pthread_cancel 586f673fd1SPhilippe Charnierfunction will fail if: 597285bccfSAlfred Perlstein.Bl -tag -width Er 607285bccfSAlfred Perlstein.It Bq Er ESRCH 617285bccfSAlfred PerlsteinNo thread could be found corresponding to that specified by the given 627285bccfSAlfred Perlsteinthread ID. 637285bccfSAlfred Perlstein.El 647285bccfSAlfred Perlstein.Sh SEE ALSO 657285bccfSAlfred Perlstein.Xr pthread_cleanup_pop 3 , 667285bccfSAlfred Perlstein.Xr pthread_cleanup_push 3 , 677285bccfSAlfred Perlstein.Xr pthread_exit 3 , 687285bccfSAlfred Perlstein.Xr pthread_join 3 , 697285bccfSAlfred Perlstein.Xr pthread_setcancelstate 3 , 707285bccfSAlfred Perlstein.Xr pthread_setcanceltype 3 , 717285bccfSAlfred Perlstein.Xr pthread_testcancel 3 727285bccfSAlfred Perlstein.Sh STANDARDS 736f673fd1SPhilippe CharnierThe 747285bccfSAlfred Perlstein.Fn pthread_cancel 756f673fd1SPhilippe Charnierfunction conforms to 76096841ecSRuslan Ermilov.St -p1003.1-96 . 777285bccfSAlfred Perlstein.Sh AUTHORS 787285bccfSAlfred PerlsteinThis man page was written by 79ded8c91aSAlexey Zelkin.An David Leonard Aq d@openbsd.org 80ded8c91aSAlexey Zelkinfor the 81ded8c91aSAlexey Zelkin.Ox 82ded8c91aSAlexey Zelkinimplementation of 83ded8c91aSAlexey Zelkin.Fn pthread_cancel . 84