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 28The 29.Fn thrd_detach 30function causes a thread to be considered detached from the rest of the 31execution environment. While detached threads are still fully 32observable, they cannot be joined with, calls to 33.Fn thrd_join 34will fail. In addition, if all non-detached 35threads have terminated, the program will terminate; detached threads 36cannot keep a program running. The act of calling 37.Fn thrd_detach 38on a thread does not cause it to terminate. 39.Sh RETURN VALUES 40Upon successful completion, the 41.Xr thrd_detach 42function returns 43.Sy thrd_success . 44Otherwise, it returns 45.Sy thrd_error , 46indicating that an error has occurred. 47.Sh INTERFACE STABILITY 48.Sy Standard 49.Sh MT-LEVEL 50.Sy MT-safe 51.Sh SEE ALSO 52.Xr pthread_detach 3C , 53.Xr thrd_create 3C , 54.Xr thrd_join 3C , 55.Xr attributes 5 , 56.Xr threads 5 57