xref: /freebsd/share/man/man9/PHOLD.9 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1*635458bcSMark Johnston.\" Copyright (c) 2015 Mark Johnston <markj@FreeBSD.org>
2*635458bcSMark Johnston.\"
3*635458bcSMark Johnston.\" Redistribution and use in source and binary forms, with or without
4*635458bcSMark Johnston.\" modification, are permitted provided that the following conditions
5*635458bcSMark Johnston.\" are met:
6*635458bcSMark Johnston.\" 1. Redistributions of source code must retain the above copyright
7*635458bcSMark Johnston.\"    notice, this list of conditions and the following disclaimer.
8*635458bcSMark Johnston.\" 2. Redistributions in binary form must reproduce the above copyright
9*635458bcSMark Johnston.\"    notice, this list of conditions and the following disclaimer in the
10*635458bcSMark Johnston.\"    documentation and/or other materials provided with the distribution.
11*635458bcSMark Johnston.\"
12*635458bcSMark Johnston.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
13*635458bcSMark Johnston.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
14*635458bcSMark Johnston.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
15*635458bcSMark Johnston.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
16*635458bcSMark Johnston.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17*635458bcSMark Johnston.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
18*635458bcSMark Johnston.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19*635458bcSMark Johnston.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20*635458bcSMark Johnston.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21*635458bcSMark Johnston.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22*635458bcSMark Johnston.\"
23*635458bcSMark Johnston.Dd November 7, 2015
24*635458bcSMark Johnston.Dt PHOLD 9
25*635458bcSMark Johnston.Os
26*635458bcSMark Johnston.Sh NAME
27*635458bcSMark Johnston.Nm PHOLD
28*635458bcSMark Johnston.Nd hold a process
29*635458bcSMark Johnston.Sh SYNOPSIS
30*635458bcSMark Johnston.In sys/proc.h
31*635458bcSMark Johnston.Fn PHOLD "struct proc *p"
32*635458bcSMark Johnston.Fn _PHOLD "struct proc *p"
33*635458bcSMark Johnston.Fn PRELE "struct proc *p"
34*635458bcSMark Johnston.Fn _PRELE "struct proc *p"
35*635458bcSMark Johnston.Fn PROC_ASSERT_HELD "struct proc *p"
36*635458bcSMark Johnston.Fn PROC_ASSERT_NOT_HELD "struct proc *p"
37*635458bcSMark Johnston.Sh DESCRIPTION
38*635458bcSMark JohnstonThe
39*635458bcSMark Johnston.Fn PHOLD
40*635458bcSMark Johnstonmacro increments the hold count of a process, and the
41*635458bcSMark Johnston.Fn PRELE
42*635458bcSMark Johnstonmacro decrements the hold count of a process.
43*635458bcSMark Johnston.Pp
44*635458bcSMark JohnstonIf a process with a non-zero hold count attempts to exit, it will sleep until
45*635458bcSMark Johnstonits hold count has reached zero before the kernel begins releasing resources
46*635458bcSMark Johnstonassociated with the process.
47*635458bcSMark JohnstonOnce a process has started exiting, it is invalid to increase its hold count.
48*635458bcSMark JohnstonThus, callers must not attempt to hold a process that has the
49*635458bcSMark Johnston.Dv P_WEXIT
50*635458bcSMark Johnstonflag set.
51*635458bcSMark JohnstonThe VM daemon will not swap out the kernel stack of a thread belonging to a
52*635458bcSMark Johnstonprocess with a non-zero hold count.
53*635458bcSMark Johnston.Pp
54*635458bcSMark JohnstonThe
55*635458bcSMark Johnston.Fn _PHOLD
56*635458bcSMark Johnstonand
57*635458bcSMark Johnston.Fn _PRELE
58*635458bcSMark Johnstonmacros are identical to
59*635458bcSMark Johnston.Fn PHOLD
60*635458bcSMark Johnstonand
61*635458bcSMark Johnston.Fn PRELE ,
62*635458bcSMark Johnstonexcept that they must be called with the process lock held.
63*635458bcSMark Johnston.Sh AUTHORS
64*635458bcSMark JohnstonThis manual page was written by
65*635458bcSMark Johnston.An Mark Johnston Aq Mt markj@FreeBSD.org .
66