From owner-freebsd-current Wed Feb 20 14:30:52 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by hub.freebsd.org (Postfix) with ESMTP id 9844F37B449 for ; Wed, 20 Feb 2002 14:27:47 -0800 (PST) Received: (qmail 5106 invoked from network); 20 Feb 2002 22:27:46 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([65.90.117.57]) (envelope-sender ) by mail6.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 20 Feb 2002 22:27:46 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3C720859.C77590F0@mindspring.com> Date: Wed, 20 Feb 2002 17:27:48 -0500 (EST) From: John Baldwin To: Terry Lambert Subject: Re: Patch sets to date and timing tests with Giant out of userre Cc: current@FreeBSD.ORG, Peter Wemm , Matthew Dillon , Julian Elischer Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 19-Feb-02 Terry Lambert wrote: > Julian Elischer wrote: >> The fully safe version of this code is: >> td->td_retval[0] = td->td_ucred->cr_ruid; >> td->td_retval[1] = td->td_ucred->cr_uid; >> return (0); >> >> because td->td_ucred is read-only for it's whole existance. > > ??? > > Are you sure that td->td_ucred can't change in the middle, > to point to a different ucred, as a result of kernel > preemption? Yes. A thread's ucred pointer is constant teh entire time that it is in the kernel. If we get preempted who cares. We will still be teh same thread when we continue executing. :) -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message