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 9ec7452f1SRuslan Ermilov.Lb libpthread 107285bccfSAlfred Perlstein.Sh SYNOPSIS 1132eef9aeSRuslan Ermilov.In pthread.h 127285bccfSAlfred Perlstein.Ft int 137285bccfSAlfred Perlstein.Fn pthread_cancel "pthread_t thread" 147285bccfSAlfred Perlstein.Sh DESCRIPTION 157285bccfSAlfred PerlsteinThe 167285bccfSAlfred Perlstein.Fn pthread_cancel 177285bccfSAlfred Perlsteinfunction requests that 187285bccfSAlfred Perlstein.Fa thread 19c6ff3a1bSSheldon Hearnbe canceled. 20c6ff3a1bSSheldon HearnThe target thread's cancelability state and type determines 21c6ff3a1bSSheldon Hearnwhen the cancellation takes effect. 22c6ff3a1bSSheldon HearnWhen the cancellation is acted on, 237285bccfSAlfred Perlsteinthe cancellation cleanup handlers for 247285bccfSAlfred Perlstein.Fa thread 25c6ff3a1bSSheldon Hearnare called. 26c6ff3a1bSSheldon HearnWhen the last cancellation cleanup handler returns, 277285bccfSAlfred Perlsteinthe thread-specific data destructor functions will be called for 287285bccfSAlfred Perlstein.Fa thread . 297285bccfSAlfred PerlsteinWhen the last destructor function returns, 307285bccfSAlfred Perlstein.Fa thread 317285bccfSAlfred Perlsteinwill be terminated. 327285bccfSAlfred Perlstein.Pp 337285bccfSAlfred PerlsteinThe cancellation processing in the target thread runs asynchronously with 347285bccfSAlfred Perlsteinrespect to the calling thread returning from 357285bccfSAlfred Perlstein.Fn pthread_cancel . 367285bccfSAlfred Perlstein.Pp 377285bccfSAlfred PerlsteinA status of 387285bccfSAlfred Perlstein.Dv PTHREAD_CANCELED 39c6ff3a1bSSheldon Hearnis made available to any threads joining with the target. 40c6ff3a1bSSheldon HearnThe symbolic 417285bccfSAlfred Perlsteinconstant 427285bccfSAlfred Perlstein.Dv PTHREAD_CANCELED 437285bccfSAlfred Perlsteinexpands to a constant expression of type 447285bccfSAlfred Perlstein.Ft "(void *)" , 457285bccfSAlfred Perlsteinwhose value matches no pointer to an object in memory nor the value 467285bccfSAlfred Perlstein.Dv NULL . 477285bccfSAlfred Perlstein.Sh RETURN VALUES 487285bccfSAlfred PerlsteinIf successful, the 497285bccfSAlfred Perlstein.Fn pthread_cancel 50c6ff3a1bSSheldon Hearnfunctions will return zero. 51c6ff3a1bSSheldon HearnOtherwise an error number will be returned to 527285bccfSAlfred Perlsteinindicate the error. 537285bccfSAlfred Perlstein.Sh ERRORS 546f673fd1SPhilippe CharnierThe 557285bccfSAlfred Perlstein.Fn pthread_cancel 566f673fd1SPhilippe Charnierfunction will fail if: 577285bccfSAlfred Perlstein.Bl -tag -width Er 587285bccfSAlfred Perlstein.It Bq Er ESRCH 597285bccfSAlfred PerlsteinNo thread could be found corresponding to that specified by the given 607285bccfSAlfred Perlsteinthread ID. 617285bccfSAlfred Perlstein.El 627285bccfSAlfred Perlstein.Sh SEE ALSO 637285bccfSAlfred Perlstein.Xr pthread_cleanup_pop 3 , 647285bccfSAlfred Perlstein.Xr pthread_cleanup_push 3 , 657285bccfSAlfred Perlstein.Xr pthread_exit 3 , 667285bccfSAlfred Perlstein.Xr pthread_join 3 , 677285bccfSAlfred Perlstein.Xr pthread_setcancelstate 3 , 687285bccfSAlfred Perlstein.Xr pthread_setcanceltype 3 , 697285bccfSAlfred Perlstein.Xr pthread_testcancel 3 707285bccfSAlfred Perlstein.Sh STANDARDS 716f673fd1SPhilippe CharnierThe 727285bccfSAlfred Perlstein.Fn pthread_cancel 736f673fd1SPhilippe Charnierfunction conforms to 74096841ecSRuslan Ermilov.St -p1003.1-96 . 757285bccfSAlfred Perlstein.Sh AUTHORS 76a1601503SHiten PandyaThis manual page was written by 77*a63d6c94SBaptiste Daroussin.An David Leonard Aq Mt d@openbsd.org 78ded8c91aSAlexey Zelkinfor the 79ded8c91aSAlexey Zelkin.Ox 80ded8c91aSAlexey Zelkinimplementation of 81ded8c91aSAlexey Zelkin.Fn pthread_cancel . 82