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.Dd July 5, 2002 28eecc3125SJulian Elischer.Dt THREAD_EXIT 9 29eecc3125SJulian Elischer.Os 30eecc3125SJulian Elischer.Sh NAME 31cdd53b15SRuslan Ermilov.Nm thread_exit 32cdd53b15SRuslan Ermilov.Nd abandon current thread context 33eecc3125SJulian Elischer.Sh SYNOPSIS 34eecc3125SJulian Elischer.In sys/param.h 35eecc3125SJulian Elischer.In sys/proc.h 36eecc3125SJulian Elischer.Ft void 37eecc3125SJulian Elischer.Fn thread_exit "void" 38eecc3125SJulian Elischer.Sh DESCRIPTION 39eecc3125SJulian ElischerThe 40eecc3125SJulian Elischer.Fn thread_exit 41eecc3125SJulian Elischerfunction implements the machine independent prelude to a thread 42eecc3125SJulian Elischershutdown. 43eecc3125SJulian ElischerIt will not return, and will result in a call to 44eecc3125SJulian Elischer.Xr mi_switch 9 45eecc3125SJulian Elischerto schedule some other thread. 46eecc3125SJulian Elischer.Pp 47eecc3125SJulian Elischer.Fn thread_exit 48eecc3125SJulian Elischerarranges to free all the resources of the thread, specifically the kernel 49eecc3125SJulian Elischerstack. 50eecc3125SJulian Elischer.Pp 51eecc3125SJulian ElischerTo protect the 52eecc3125SJulian Elischer.Xr runqueue 9 , 53eecc3125SJulian Elischer.Fn thread_exit 54eecc3125SJulian Elischermust be called with the 55eecc3125SJulian Elischer.Va sched_lock 56eecc3125SJulian Elischermutex held. 57eecc3125SJulian Elischer.Sh SEE ALSO 58cdd53b15SRuslan Ermilov.Xr mi_switch 9 , 59cdd53b15SRuslan Ermilov.Xr mutex 9 , 60e7573e7aSJohn Baldwin.Xr runqueue 9 , 61e7573e7aSJohn Baldwin.Xr sleep 9 62