This routine sets the cancelability type and returns the previous type in location oldtype. When a thread's cancelability state is set to PTHREAD_CANCEL_ DISABLE, (see pthread_setcancelstate()), a cancelation request cannot be delivered to that thread, even if a cancelable routine is called or asynchronous cancelability type is enabled. When the cancelability state is set to PTHREAD_CANCEL_ENABLE, cancelability depends on the thread's cancelability type, as follows: o If the thread's cancelability type is PTHREAD_CANCEL_DEFERRED, the thread can only receive a cancelation request at a cancelation point (including condition waits, thread joins, and calls to pthread_testcancel()). o If the thread's cancelability type is PTHREAD_CANCEL_ ASYNCHRONOUS, the thread can be canceled at any point in its execution. When a thread is created, the default cancelability type is PTHREAD_CANCEL_DEFERRED. CAUTION If the asynchronous cancelability type is set, do not call any routine unless it is explicitly documented as "safe for asynchronous cancelation." Note that none of the general run-time libraries and none of the POSIX Threads libraries are safe for asynchronous cancelation except for pthread_ setcanceltype() and pthread_setcancelstate(). Use asynchronous cancelability only when you have a compute- bound section of code that carries no state and makes no routine calls.