pthread_cancel(3pthread)


pthread_cancel -- cancel execution of a thread

SYNOPSIS

   cc [options] -Kthread file
   

#include <pthread.h>

int pthread_cancel(pthread_t thread);

Description

pthread_cancel requests that thread be canceled. The target thread's cancelability state and type determines when the cancellation takes effect. When the cancellation is acted on, the cancellation cleanup handlers for thread are called. When the last cancellation cleanup handler returns, the thread-specific data destructor functions are called for thread. When the last destructor function returns, thread is terminated.

The cancellation processing in the target thread runs asynchronously with respect to the calling thread returning from pthread_cancel.

Return values

pthread_cancel function returns zero on success. Otherwise, an error number is returned to indicate the error.

Diagnostics

The pthread_cancel function may fail if:

ESRCH
No thread could be found corresponding to that specified by the given thread ID.

Standards compliance

The Single UNIX Specification, Version 2; The Open Group.

References

pthread(4) pthread_cleanup_pop(3pthread), pthread_cleanup_push(3pthread), pthread_exit(3pthread), pthread_join(3pthread), pthread_setcancelstate(3pthread), pthread_setcanceltype(3pthread), pthread_testcancel(3pthread),
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004