[Previous] [Contents] [Next]

pthread_abort()

Unconditionally terminate the target thread

Synopsis:

#include <pthread.h>

int pthread_abort( pthread_t thread );

Library:

libc

Description:

The pthread_abort() function terminates the target thread. Termination takes effect immediately and isn't a function of the cancelability state of the target thread. No cancellation handlers or thread-specific data destructor functions are executed. Thread abortion doesn't release any application visible process resources, including, but not limited to, mutexes and file descriptors. (The behavior of POSIX calls following a call to pthread_abort() is unspecified.)

The status of PTHREAD_ABORTED is available to any thread joining with the target thread. The constant PTHREAD_ABORTED expands to a constant expression, of type void *. It's value matches no pointer to an object in memory, nor the values NULL or PTHREAD_CANCELED.

The side effects of aborting a thread that's suspended during a call of a POSIX 1003.1 function are the same as the side effects that may be seen in a single-threaded process when a call to a POSIX 1003.1 function is interrupted by a signal and the given function returns EINTR. Any such side effects occur before the thread terminates.

Returns:

EOK
Success.
ESRCH
No thread was found corresponding to that specified by the given thread ID.

Classification:

QNX 6

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

pthread_cancel(), pthread_detach(), pthread_exit(), ThreadDestroy()


[Previous] [Contents] [Next]