Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (n - p) pthread_exit(2)
NAME
pthread_exit - Terminates the calling thread
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
32-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/zputdll
64-bit H-series and J-series OSS processes that use the POSIX User Thread Model library:
/G/system/zdllnnn/yputdll
H-series and J-series OSS processes that use the Standard POSIX Threads library:
/G/system/zdllnnn/zsptdll
SYNOPSIS
#include <pthread.h> | #include <spthread.h>
/* pthread.h is required to use POSIX User Thread Model library */
/* spthread.h is required to use Standard POSIX Threads library */
void pthread_exit(
void *value_ptr);
PARAMETERS
value_ptr Specifies the value to be copied and returned to the caller of the pthread_join()
function. Note that void * is used as a universal datatype, not as a pointer. The
system treats the value_ptr parameter as a value and stores it to be returned by
pthread_join().
DESCRIPTION
This function terminates the calling thread and makes a status value (value_ptr) available to any
thread that calls pthread_join() to join the terminating thread.
Any cleanup handlers that have been pushed and not yet popped from the stack are popped in the
reverse order that they were pushed and then executed. After all cleanup handlers have been
executed, if the thread has any thread-specific data, appropriate destructor functions are called.
Thread termination does not release any application-visible process resources, including, but not
limited to, mutexes and file descriptors, nor does it perform any process-level cleanup actions,
including, but not limited to, calling any atexit routine that might exist.
An implicit call to pthread_exit( ) is issued when a thread returns from the start routine that was
used to create it. The system writes the function’s return value as the return value in the thread’s
thread object. The process exits with an exit status of 0 (zero) when the last running thread calls
pthread_exit().
On systems running H06.21 or later H-series RVUs or J06.10 or later J-series RVUs, you can use
either the POSIX User Thread Model library or the Standard POSIX Threads library for threaded
applications.
To use this function in a threaded application that uses the POSIX User Thread Model library on
systems running H06.21 or later RVUs or J06.10 or later RVUs, you must perform all of the fol-
lowing tasks:
Include the pthread.h header file in the application.
Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
Link the application to the zputdll library (/G/system/zdllnnn/zputdll).
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
the POSIX User Thread Model library with 32-bit or 64-bit threaded applications.
527186-023 Hewlett-Packard Company 5111