Wait for the specified thread to terminate and reclaim its resources.

Synopsis

Declared in <bslmt_threadutil.h>

static
int
join(
    Handle& threadHandle,
    void** status = 0);

Description

Suspend execution of the current thread until the thread referred to by the specified threadHandle terminates, and reclaim any system resources associated with threadHandle. Return 0 on success, and a non‐zero value otherwise. If the optionally specified status is not 0, load into *status the value returned by the function supplied at the creation of the thread identified by threadHandle. The behavior is undefined unless threadHandle was obtained by a call to create.

Return Value

0 on success, and a non‐zero value otherwise

Parameters

Name

Description

threadHandle

thread to wait for

status

if non‐null, receives the thread's exit status

Created with MrDocs