Multithreaded Programming Guide

Creating a Cancellation Point

Use pthread_testcancel(3C) to establish a cancellation point for a thread.

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.

pthread_testcancel Return Values

pthread_testcancel() has no return value.