Unleashed v1.4
[unleashed.git] / share / man / man3c / thrd_detach.3c
blob4f19042c2cda3c640c29096af0ead6cbca957ea6
1 .\"
2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
5 .\" 1.0 of the CDDL.
6 .\"
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source.  A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
10 .\"
11 .\"
12 .\" Copyright (c) 2015, Joyent, Inc.
13 .\" Copyright 2016 Joyent, Inc.
14 .\"
15 .Dd "Jan 13, 2015"
16 .Dt THRD_DETACH 3C
17 .Os
18 .Sh NAME
19 .Nm thrd_detach
20 .Nd detach a thread
21 .Sh SYNOPSIS
22 .In threads.h
23 .Ft int
24 .Fo thrd_detach
25 .Fa "thrd_t thrd"
26 .Fc
27 .Sh DESCRIPTION
28 The
29 .Fn thrd_detach
30 function causes a thread to be considered detached from the rest of the
31 execution environment.
32 While detached threads are still fully observable, they cannot be joined with,
33 calls to
34 .Fn thrd_join
35 will fail.
36 In addition, if all non-detached threads have terminated, the program will
37 terminate; detached threads cannot keep a program running.
38 The act of calling
39 .Fn thrd_detach
40 on a thread does not cause it to terminate.
41 .Sh RETURN VALUES
42 Upon successful completion, the
43 .Xr thrd_detach 3C
44 function returns
45 .Sy thrd_success .
46 Otherwise, it returns
47 .Sy thrd_error ,
48 indicating that an error has occurred.
49 .Sh INTERFACE STABILITY
50 .Sy Standard
51 .Sh MT-LEVEL
52 .Sy MT-safe
53 .Sh SEE ALSO
54 .Xr pthread_detach 3C ,
55 .Xr thrd_create 3C ,
56 .Xr thrd_join 3C ,
57 .Xr attributes 5 ,
58 .Xr threads 5