From owner-cvs-all Tue Nov 13 14:40:19 2001 Delivered-To: cvs-all@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id 337EA37B41A; Tue, 13 Nov 2001 14:40:11 -0800 (PST) Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA00157; Tue, 13 Nov 2001 14:29:11 -0800 (PST) Date: Tue, 13 Nov 2001 14:29:10 -0800 (PST) From: Julian Elischer To: John Baldwin Cc: Archie Cobbs , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_timeout.c src/sys/sys callout. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG It is not important to know if it has run, just that it was dequeued BY YOU. i.e. it's your responsibility to remove its reference count.. If it was never there to start with: Don't decrement refcount. If it ran and was dequeued for that reason: Don't decrement refcount If YOU dequeued it: DO decrement refcount On Tue, 13 Nov 2001, John Baldwin wrote: > Yes, it is useful in this case. However, all this tells you is that the > handler has been dequeued. You don't know if it has already run or will run > in the future however. Determining that is another trick. For the > endtsleep race, we use the TDF_TIMOFAIL flag to test this. In the case you > describe I think it is simpler though as the timeout will always do the > decrement, so you simply don't decrement if the callout_stop() fails. > > -- > > 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 cvs-all" in the body of the message