多线程编程指南

pthread_setcancelstate 语法

int	pthread_setcancelstate(int state, int *oldstate);
#include <pthread.h>



int oldstate;

int ret;



/* enabled */

ret = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate);



/* disabled */

ret = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate);