pthread_cancel man page on BSDOS
[printable version]
PTHREAD_CANCEL(3) BSD Programmer's Manual PTHREAD_CANCEL(3)
NAME
pthread_cancel - request that the specified thread be canceled
SYNOPSIS
#include <pthread.h>
int
pthread_cancel(pthread_t thread);
DESCRIPTION
Request that thread be canceled. When the cancellation takes effect is
controlled by the cancelability state and type of the target thread, see
pthread_setcancelstate(3) and pthread_setcanceltype(3).
The actions taken when cancellation is acted on are equivalent to the ac-
tions taken if thread had called pthread_exit(3). The cancellation pro-
cessing in the target thread runs asynchronously with respect to the
calling thread returning from pthread_cancel().
Thread cancelation is enabled and disabled the thread_setcancelstate(3)
function; thread cancellation is enabled by default.
There are two types of thread cancellation, controlled by the thread_set-
canceltype(3) function. The default is ``deferred'' cancellation which
will only take effect at a specified cancellation point (see below). The
use of the thread_cleanup_push(3), thread_cleanup_pop(3) and thread_set-
cancelstate(3) functions make it possible to insure that no resources are
lost when deferred cancellation is used.
A thread may also be configured for ``asynchronous'' cancellation which
will take effect when the thread scheduler dispatches the canceled thread
to run again. It is not possible to insure the reclamation of resources
when a thread is configured for asynchronous cancellation.
CANCELLATION POINTS
Deferred cancellation will only occur at a cancellation point. Cancella-
tion points are acted on when thread may block in any of the following
functions:
accept(2), close(2), connect(2), create(2), fsync(2), pause(3),
pthread_cond_timedwait(3), pthread_cond_wait(3), pthread_join(3),
sigwait(2), sleep(3), system(3), msync(2), open(2), fcntl(2) (when
cmd argument is F_SETLKW), flockfile(2), read(2), readv(2), recv(2),
recvfrom(2), recvmsg(2), send(2), sendmsg(2), sendto(2),
sigsuspend(2), tcdrain(3), usleep(3), wait(2), waitpid(2), wait4(2),
write(2), writev(2).
When a cancellation is pending, cancellation will always occur in
pthread_testcancel(3),
Note that other library routines may call these functions and thereby be-
have as a cancellation point.
RETURN VALUES
If successful, the pthread_cancel() function will return zero. Otherwise
an error number will be returned to indicate the error.
ERRORS
For each of the following conditions, if the condition is detected, the
pthread_cancel() function shall return the corresponding error number:
[ESRCH] No thread could be found corresponding to the specified
thread ID.
SEE ALSO
pthreads(3), pthread_cond_timedwait(3), pthread_cond_wait(3),
pthread_exit(3), pthread_join(3), pthread_setcancelstate(3),
pthread_setcanceltype(3), pthread_testcancel(3)
STANDARDS
The pthread_cancel() function conforms to IEEE Std1003.1c (``POSIX'').
HISTORY
The pthread_cancel() function first appeared in BSD/OS 4.1.
4th Berkeley Distribution Oct 1, 1999 2
[top]
_ _ _
| | | | | |
| | | | | |
__ | | __ __ | | __ __ | | __
\ \| |/ / \ \| |/ / \ \| |/ /
\ \ / / \ \ / / \ \ / /
\ / \ / \ /
\_/ \_/ \_/
More information is available in HTML format for server BSDOS
List of man pages available for BSDOS
Copyright (c) for man pages and the logo by the respective OS vendor.
For those who want to learn more, the polarhome community provides shell access and support.
[legal]
[privacy]
[GNU]
[policy]
[cookies]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
|
Vote for polarhome
|