*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> pthread_exit (3)              



NAME    [Toc]    [Back]

     pthread_exit - terminate the calling thread

SYNOPSIS    [Toc]    [Back]

     #include <pthread.h>

     pthread_exit(void *value_ptr);

DESCRIPTION    [Toc]    [Back]

     The pthread_exit() function terminates  the  calling  thread
and makes the
     value  value_ptr  available  to any successful join with the
     thread.  Any cancellation cleanup handlers  that  have  been
pushed and are
     not  yet  popped  are  popped in the reverse order that they
were pushed and
     then executed.  After all cancellation  handlers  have  been
executed, if
     the  thread  has  any  thread-specific data, appropriate destructor functions
     are called in an unspecified order.  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
atexit() routines
     that may exist.

     An implicit call to pthread_exit() is  made  when  a  thread
other than the
     thread  in  which  main() was first invoked returns from the
start routine
     that was used to create  it.  The  function's  return  value
serves as the
     thread's exit status.

     The behavior of pthread_exit() is undefined if called from a
     handler or destructor function that was invoked as  the  result of an implicit
 or explicit call to pthread_exit().

     After a thread has terminated, the result of access to local
(auto) variables
 of the thread is undefined.  Thus, references to local
variables of
     the exiting thread should not be used for the pthread_exit()
     parameter value.

     The process will exit with an exit status  of  0  after  the
last thread has
     been  terminated.   The behavior is as if the implementation
called exit()
     with a zero argument at thread termination time.

RETURN VALUES    [Toc]    [Back]

     The pthread_exit() function cannot return to its caller.

ERRORS    [Toc]    [Back]


SEE ALSO    [Toc]    [Back]

     _exit(2), exit(3), pthread_create(3), pthread_join(3)

STANDARDS    [Toc]    [Back]

     pthread_exit() conforms to ISO/IEC 9945-1:1996  (``POSIX'').

OpenBSD      3.6                           April      4,     1996
[ Back ]
 Similar pages
Name OS Title
_exit OpenBSD terminate the calling process
_exit NetBSD terminate the calling process
_exit FreeBSD terminate the calling process
pthread_join Tru64 Causes the calling thread to wait for the termination of the specified thread
pthread_cancel Tru64 Allows a thread to request a thread to terminate execution
pthread_exit Tru64 Terminates the calling thread
tis_self Tru64 Obtains the identifier of the calling thread
pthread_self Tru64 Obtains the identifier of the calling thread
sigwait Tru64 Suspend a calling thread until a signal arrives
sigtimedwait Tru64 Suspend a calling thread until a signal arrives
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service