A thread's cancelability state is determined by the combination of two substates: general cancelability and asynchronous cancelability. These substates can be set to either CANCEL_ON or CANCEL_OFF by calls to the routines pthread_setcancel( ) and pthread_setasynccancel( ) respectively. A thread's cancelability state is determined by its general and asynchronous cancelability substates, as shown in the following table.
Cancelability State
General Cancelability | Asynchronous Cancelability | Cancelability State |
CANCEL_OFF | CANCEL_OFF | disabled |
CANCEL_OFF | CANCEL_ON | disabled |
CANCEL_ON | CANCEL_OFF | deferred |
CANCEL_ON | CANCEL_ON | asynchronous |