Date: Mon, 26 Dec 2016 13:04:01 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: jinjun gao <gjinjun@gmail.com> Cc: freebsd-threads@freebsd.org Subject: Re: Why need not to PROC_UNLOCK() in kthread_suspend()/kproc_suspend()? Message-ID: <20161226110400.GP94325@kib.kiev.ua> In-Reply-To: <CAORc1LBjzrADNr5_-zg1nt5qDRPVRyzUpRQxkuWCOMtb2QG9dQ@mail.gmail.com> References: <CAORc1LBjzrADNr5_-zg1nt5qDRPVRyzUpRQxkuWCOMtb2QG9dQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 26, 2016 at 06:26:48PM +0800, jinjun gao wrote: > Hi Guys, > > In file sys/kern/kern_kthread.c ( > https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_kthread.c), > the PROC_LOCK() and PROC_UNLOCK() are used in pairs in one function except > function kthread_suspend()/kproc_suspend() ( > https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_kthread.c#L177). > In these two functions, there is only PROC_LOCK(). I checked may related > function(such as kproc_resume()) and can not find PROC_UNLOCK() to pair the > one resided in kproc_suspend(). Why need not PROC_UNLOCK() to pair > PROC_LOCK() in kproc_suspend()/kthread_suspend()? Thanks! > Because later msleep(9) is called with the process lock and PDROP flag.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161226110400.GP94325>