Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Jul 2002 16:13:06 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        Jonathan Lemon <jlemon@flugsvamp.com>
Cc:        current@freebsd.org
Subject:   Re: additional queue macro 
Message-ID:   <200207021613.aa59595@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Tue, 02 Jul 2002 09:54:02 CDT." <20020702095402.D1020@prism.flugsvamp.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20020702095402.D1020@prism.flugsvamp.com>, Jonathan Lemon writes:
>Essentially, this provides a traversal of the tailq that is safe 
>from element removal, while being simple to drop in to those sections
>of the code that need updating, as evidenced in the patch below.

Note that this of course is not "safe from element removal" in
general; it is just safe when you remove any element other than the
next element, whereas TAILQ_FOREACH is safe when you remove any
element other than the current one. For example it would not be
safe to call a callback that could potentially remove arbitrary
elements.

It may be clearer in this case just to expand the macro in the code
so that it is more obvious what assumptions can be made.

Ian

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <200207021613.aa59595>