ft_thread_join,(1)

NAME
ft_thread_join, ft_thread_join_n - wait for termination of another thread

  SYNOPSIS

#include <fthread.h>
int ft_thread_join   (ft_thread_t th);
int ft_thread_join_n (ft_thread_t th,int n);

  DESCRIPTION
ft_thread_join suspends the execution of the calling thread until the thread th terminates (either by reaching the end of the function it run, or by executing ft_exit) or is stopped (by ft_scheduler_stop). If th is already terminated, the call immediately terminates. ft_thread_join_n (th,i) waits for at most i instants for termination of th.

  RETURN VALUES
On success, the value 0 is returned. On error, a non-zero error code is returned.

  ERRORS

    BADCREATE
        The thread th is not correctly created.

    BADLINK
        The calling thread is unlinked.

    TIMEOUT
        The timeout is reached before the thread is joined.

  SEE ALSO
ft_thread_create (3), ft_exit (3), ft_scheduler_stop (3).

AUTHOR