Multithreaded Programming Guide

pthread_testcancel Syntax

void pthread_testcancel(void);
#include <pthread.h>

pthread_testcancel(); 

The pthread_testcancel() function is effective when thread cancellation is enabled and in deferred mode. pthread_testcancel() has no effect if called while cancellation is disabled.

Be careful to insert pthread_testcancel() only in sequences where thread cancellation is safe. In addition to programmatically establishing cancellation points through the pthread_testcancel() call, the pthreads standard specifies several cancellation points. See Cancellation Points for more details.