THRD_DETACH(3C) Standard C Library Functions THRD_DETACH(3C)
thrd_detach - detach a thread
#include <threads.h>
int
thrd_detach(thrd_t thrd);
The thrd_detach() function causes a thread to be considered detached
from the rest of the execution environment. While detached threads are
still fully observable, they cannot be joined with, calls to
thrd_join() will fail. In addition, if all non-detached threads have
terminated, the program will terminate; detached threads cannot keep a
program running. The act of calling thrd_detach() on a thread does not
cause it to terminate.
Upon successful completion, the thrd_detach() function returns
thrd_success. Otherwise, it returns thrd_error, indicating that an
error has occurred.
Standard
MT-LEVEL
MT-safe
pthread_detach(3C), thrd_create(3C), thrd_join(3C), attributes(7),
threads(7)
illumos January 13, 2015 illumos
NAME
thrd_detach - detach a thread
SYNOPSIS
#include <threads.h>
int
thrd_detach(thrd_t thrd);
DESCRIPTION
The thrd_detach() function causes a thread to be considered detached
from the rest of the execution environment. While detached threads are
still fully observable, they cannot be joined with, calls to
thrd_join() will fail. In addition, if all non-detached threads have
terminated, the program will terminate; detached threads cannot keep a
program running. The act of calling thrd_detach() on a thread does not
cause it to terminate.
RETURN VALUES
Upon successful completion, the thrd_detach() function returns
thrd_success. Otherwise, it returns thrd_error, indicating that an
error has occurred.
INTERFACE STABILITY
Standard
MT-LEVEL
MT-safe
SEE ALSO
pthread_detach(3C), thrd_create(3C), thrd_join(3C), attributes(7),
threads(7)
illumos January 13, 2015 illumos