Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_join.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_join.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_join.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_join.html on line 8

pthread_join()

Join thread

Synopsis:

#include <pthread.h>

int pthread_join( pthread_t thread,
                  void** value_ptr );

Arguments:

thread
The target thread whose termination you're waiting for.
value_ptr
NULL, or a pointer to a location where the function can store the value passed to pthread_exit() by the target thread.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The pthread_join() function blocks the calling thread until the target thread thread terminates, unless thread has already terminated. If value_ptr is non-NULL and pthread_join() returns successfully, then the value passed to pthread_exit() by the target thread is placed in value_ptr. If the target thread has been canceled then value_ptr is set to PTHREAD_CANCELED.


Note: The non-POSIX pthread_timedjoin() function is similar to pthread_join(), except that an error is returned if the join doesn't occur before a given time.

The target thread must be joinable. Multiple pthread_join(), pthread_timedjoin(), ThreadJoin(), and ThreadJoin_r() calls on the same target thread aren't allowed. When pthread_join() returns successfully, the target thread has been terminated.

Returns:

EOK
Success.
EBUSY
The thread thread is already being joined.
EDEADLK
The thread thread is the calling thread.
EFAULT
A fault occurred trying to access the buffers provided.
EINVAL
The thread thread isn't joinable.
ESRCH
The thread thread doesn't exist.

Classification:

POSIX 1003.1 THR

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

See also:

pthread_create(), pthread_detach(), pthread_exit(), pthread_timedjoin(), ThreadJoin(), ThreadJoin_r()

Processes and Threads chapter of Getting Started with QNX Neutrino


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_join.html on line 184

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/p/pthread_join.html on line 184