4.9.   147

    ,   
.  ,   ,    -
,  .      -
,      .     -
 ,    .  ,  -
   ,   ,   
 ,   .      ""
  ,         
 . ,  ,   , 
  ,      " "  -
    .  ,    -
   ,     " " .

    (cancelability state)  , 
   (  )  .  
(cancelabilty type)      
    .     -
        (
)    .       -
    .

        -
     pthread_setcancelstate ()
Hpthread_setcanceltype().  pthread_setcancelstate() -
    ,   state,   -
    oldstate.



#include <pthread.h>

int pthread_setcancelstate(int state, int *oldstate);

int pthread_setcanceltype(int type, int *oldtype) ;

 state  oldstate    :

PTHREAD_CANCEL_DISABLE
PTHREAD_CANCEL_ENABLE

 PTHREAD_CANCEL_DI SABLE  ,    
   ,   PTHREAD_CANCEL_ENABLE  -
,    ""    ( -
       ).  
    0,      . -
 pthread_setcancelstate ()    ,  
   state  .

 pthread_setcanceltype ()     
,   type,     
  oldtype.  type  oldtype    :

PTHREAD_CANCEL_DEFFERED
PTHREAD CANCEL ASYNCHRONOUS