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