Is pthread_setcancelstate function a cancellation point when enabling cancelability
===


Man page of `pthread_cancel` says:

> The cancellation state can be set to PTHREAD_CANCEL_DISABLE, in which
> case all cancellation requests are held pending,

That is clear. 
If there is a pending cancellation request, and `pthread_setcancelstate` call enables cancelability, when the thread is canceled?

 1. during the `pthread_setcancelstate` call
 2. at the next cancellation point

The default cancellation type (PTHREAD_CANCEL_DEFERRED) is used.

  