pthread_setcancelstate(3) Library Functions Manual pthread_setcancelstate(3) pthread_setcancelstate, pthread_setcanceltype - POSIX (libpthread -lpthread) #include int pthread_setcancelstate(int state, int *oldstate); int pthread_setcanceltype(int type, int *oldtype); pthread_setcancelstate() state. oldstate. state : PTHREAD_CANCEL_ENABLE . . . PTHREAD_CANCEL_DISABLE . . pthread_setcanceltype() type. oldtype. type : PTHREAD_CANCEL_DEFERRED ( pthreads(7)). . . PTHREAD_CANCEL_ASYNCHRONOUS . ( .) . 0 . pthread_setcancelstate() : EINVAL state. pthread_setcanceltype() : EINVAL type. attributes(7). +--------------------------+-----------------------------------------------------------------------+--------------------+ | | | | +--------------------------+-----------------------------------------------------------------------+--------------------+ |pthread_setcancelstate(), | | MT-Safe | |pthread_setcanceltype() | | | +--------------------------+-----------------------------------------------------------------------+--------------------+ |pthread_setcancelstate(), | | AC-Safe | |pthread_setcanceltype() | | | +--------------------------+-----------------------------------------------------------------------+--------------------+ POSIX.1-2008. glibc 2.0 POSIX.1-2001. pthread_cancel(3). . . PTHREAD_CANCEL_ASYNCHRONOUS . ( malloc(3)) . ( malloc(3)) . . . POSIX.1-2001 POSIX.1-2008 pthread_cancel(3) pthread_setcancelstate() pthread_setcanceltype() . . . Linux oldstate pthread_setcancelstate() NULL . oldstat NULL POSIX.1 NULL oldstate. oldtype pthread_setcanceltype(). pthread_cancel(3). pthread_cancel(3) pthread_cleanup_push(3) pthread_testcancel(3) pthreads(7) 3 . . : . 6.18 17 2025 pthread_setcancelstate(3)