THREAD_WAIT
Purpose
thread_wait waits
for the termination of a thread.
Synopsis
#include <types.h>
#include <stub.h>
int thread_wait(Capability
*thread, int *exit_status);
Parameters
-
thread: a capability for the thread
to be waited for;
-
exit_status: the thread's termination
status.
Description
thread_wait waits the thread designated
by thread to terminate and returns its termination state in exit_status.
The calling thread is blocked until the thread terminates, either by calling
thread_exit or because some other thread executed
thread_destroy on it.
Return Values
On success, thread_wait returns 0 and
exit_status contains the termination status of the thread being waited
for.
On fail, thread_wait returns a negative
value indicating one of the following errors:
See Also
thread_create,
thread_destroy, thread_status,
thread_self, thread_exit