Standard C Library Functions pthreadcancel(3C)
NAME
pthreadcancel - cancel execution of a thread
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#include
int pthreadcancel(pthreadt targetthread);
DESCRIPTION
The pthreadcancel() function requests that targetthread be
canceled.
By default, cancellation is deferred until targetthread
reaches a cancellation point. See cancellation(5).
Cancellation cleanup handlers for targetthread are called
when the cancellation is acted on. Upon return of the last
cancellation cleanup handler, the thread-specific data des-
tructor functions are called for targetthread.
targetthread is terminated when the last destructor func-
tion returns.
A thread acting on a cancellation request runs with all sig-
nals blocked. All thread termination functions, including
cancellation cleanup handlers and thread-specific data des-
tructor functions, are called with all signals blocked.
The cancellation processing in targetthread runs asynchro-
nously with respect to the calling thread returning from
pthreadcancel().
RETURN VALUES
If successful, the pthreadcancel() function returns 0.
Otherwise, an error number is returned to indicate the
error.
ERORS
The pthreadcancel() function may fail if:
ESRCH No thread was found with an ID corresponding to
that specified by the given thread ID,
targetthread.
ATRIBUTES
SunOS 5.11 Last change: 2 Nov 2007 1
Standard C Library Functions pthreadcancel(3C)
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level MT-Safe
Standard See standards(5).
SEE ALSO
pthreadcleanuppop(3C), pthreadcleanuppush(3C),
pthreadcondwait(3C), pthreadcondtimedwait(3C),
pthreadexit(3C), pthreadjoin(3C),
pthreadsetcancelstate(3C), pthreadsetcanceltype(3C),
pthreadtestcancel(3C), setjmp(3C), attributes(5), cancella-
tion(5), condition(5), standards(5)
NOTES
See cancellation(5) for a discussion of cancellation con-
cepts.
SunOS 5.11 Last change: 2 Nov 2007 2
|