Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Nov 2001 14:29:10 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Archie Cobbs <archie@dellroad.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern kern_timeout.c src/sys/sys callout.
Message-ID:  <Pine.BSF.4.21.0111131426390.99511-100000@InterJet.elischer.org>
In-Reply-To: <XFMail.011113142246.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org>  <><  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0111131426390.99511-100000>