xref: /freebsd/share/man/man9/thread_exit.9 (revision cdd53b158974c33819f54b80fd8d6dd2382df454)
1eecc3125SJulian Elischer.\"
2eecc3125SJulian Elischer.\" Copyright (c) 2002 Julian Elischer
3eecc3125SJulian Elischer.\" All rights reserved.
4eecc3125SJulian Elischer.\"
5eecc3125SJulian Elischer.\"
6eecc3125SJulian Elischer.\" Redistribution and use in source and binary forms, with or without
7eecc3125SJulian Elischer.\" modification, are permitted provided that the following conditions
8eecc3125SJulian Elischer.\" are met:
9eecc3125SJulian Elischer.\" 1. Redistributions of source code must retain the above copyright
10eecc3125SJulian Elischer.\"    notice, this list of conditions and the following disclaimer.
11eecc3125SJulian Elischer.\" 2. Redistributions in binary form must reproduce the above copyright
12eecc3125SJulian Elischer.\"    notice, this list of conditions and the following disclaimer in the
13eecc3125SJulian Elischer.\"    documentation and/or other materials provided with the distribution.
14eecc3125SJulian Elischer.\"
15eecc3125SJulian Elischer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16eecc3125SJulian Elischer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17eecc3125SJulian Elischer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18eecc3125SJulian Elischer.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19eecc3125SJulian Elischer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20eecc3125SJulian Elischer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21eecc3125SJulian Elischer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22eecc3125SJulian Elischer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23eecc3125SJulian Elischer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24eecc3125SJulian Elischer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25eecc3125SJulian Elischer.\" SUCH DAMAGE.
26eecc3125SJulian Elischer.\"
27eecc3125SJulian Elischer.\" $FreeBSD$
28eecc3125SJulian Elischer.\"
29eecc3125SJulian Elischer.Dd July 5, 2002
30eecc3125SJulian Elischer.Dt THREAD_EXIT 9
31eecc3125SJulian Elischer.Os
32eecc3125SJulian Elischer.Sh NAME
33cdd53b15SRuslan Ermilov.Nm thread_exit
34cdd53b15SRuslan Ermilov.Nd abandon current thread context
35eecc3125SJulian Elischer.Sh SYNOPSIS
36eecc3125SJulian Elischer.In sys/param.h
37eecc3125SJulian Elischer.In sys/proc.h
38eecc3125SJulian Elischer.Ft void
39eecc3125SJulian Elischer.Fn thread_exit "void"
40eecc3125SJulian Elischer.Sh DESCRIPTION
41eecc3125SJulian ElischerThe
42eecc3125SJulian Elischer.Fn thread_exit
43eecc3125SJulian Elischerfunction implements the machine independent prelude to a thread
44eecc3125SJulian Elischershutdown.
45eecc3125SJulian ElischerIt will not return, and will result in a call to
46eecc3125SJulian Elischer.Xr mi_switch 9
47eecc3125SJulian Elischerto schedule some other thread.
48eecc3125SJulian Elischer.Pp
49eecc3125SJulian Elischer.Fn thread_exit
50eecc3125SJulian Elischerarranges to free all the resources of the thread, specifically the kernel
51eecc3125SJulian Elischerstack.
52eecc3125SJulian Elischer.Pp
53eecc3125SJulian ElischerTo protect the
54eecc3125SJulian Elischer.Xr runqueue 9 ,
55eecc3125SJulian Elischer.Fn thread_exit
56eecc3125SJulian Elischermust be called with the
57eecc3125SJulian Elischer.Va sched_lock
58eecc3125SJulian Elischermutex held.
59eecc3125SJulian Elischer.Sh SEE ALSO
60cdd53b15SRuslan Ermilov.Xr mi_switch 9 ,
61eecc3125SJulian Elischer.Xr msleep 9 ,
62cdd53b15SRuslan Ermilov.Xr mutex 9 ,
63cdd53b15SRuslan Ermilov.Xr runqueue 9
64