pthread_cancel(3T)
NAME
pthread_cancel − cancel execution of a thread
SYNOPSIS
#include <pthread.h>
int pthread_cancel(pthread_t target_thread );
DESCRIPTION
pthread_cancel() requests that target_thread be canceled.
By default, cancellation is deferred until target_thread reaches a cancellation point (see cancellation(3T) for the definition of a cancellation point).
Cancellation cleanup handlers for target_thread are called when the cancellation is acted on. Upon return of the last cancellation cleanup handler, the thread-specific data destructor functions are called for target_thread. target_thread is terminated when the last destructor function returns.
RETURN VALUES
When successful, pthread_cancel() returns x 0; otherwise, an error number is returned.
ERRORS
For the following condition, pthread_cancel() returns the corresponding error when the condition occurs:
ESRCH No thread was found with an ID corresponding to that of the specified target_thread.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
| MT-Level | MT-Safe |
SEE ALSO
cancellation(3T), condition(3T), pthread_cleanup_pop(3T), pthread_cleanup_push(3T), pthread_exit(3T), pthread_join(3T), pthread_setcancelstate(3T), pthread_setcanceltype(3T), pthread_testcancel(3T), setjmp(3C), attributes(5)
NOTES
See cancellation(3T) for a discussion of cancellation concepts.
SunOS 5.6 — Last change: 6 Jan 1997