  653



pthread_setcancelstate, pthread_setcanceltype, pthread_testcancel
    () .



THR    ftinclude <pthread.h>

int pthread_setcancelstate(int state, int *o2dsta?e) ;

int pthread_setcanceltype(int type, int *o2dtype) ;

void pthread_testcancel(void);



 pthread_setcancelstate ()   
    ,   state,  -
      ,  -
 oldstate.     state 
PTHREAD_CANCEL_ENABLE  PTHREAD_CANCEL_DISABLE.

 pthread_setcanceltype ()    
   ,   type,  
     ,   oldtype.
    type  PTHREAD_CANCEL_
DEFERRED  PTHREAD_CANCEL_ASYNCHRONOUS.

      ,  ,  
   main (),   
PTHREAD_CANCEL_ENABLE  PTHREAD_CANCEL_DEFERRED .

 pthread_testcancel ()     
  .  pthread_testcancel ()   ,  -
  .

 

    pthread_setcancelstate ()  pthread_
setcanceltype ()   ;    
 ,   .



 pthread_setcancelstate ()   , :

[EINVAL]     state      PTHREAD_
CANCEL_ENABLE,   PTHREAD_CANCEL_DISABLE.

 pthread_setcanceltype ()   , :

[EINVAL]     type     PTHREAE_
CANCELJ3EFERRED,   PTHREAD_CANCEL_ASYNCHRONOUS.

      [EINTR].