atom feed28 messages in org.freebsd.freebsd-currentRe: additional queue macro
FromSent OnAttachments
Jonathan LemonJul 2, 2002 7:53 am 
W Gerald HicksJul 2, 2002 8:08 am 
Ian DowseJul 2, 2002 8:12 am 
Garrett WollmanJul 2, 2002 9:53 am 
Julian ElischerJul 2, 2002 12:58 pm 
Jonathan LemonJul 2, 2002 1:34 pm 
Julian ElischerJul 2, 2002 1:47 pm 
Terry LambertJul 2, 2002 3:43 pm 
Julian ElischerJul 2, 2002 4:07 pm 
Garrett WollmanJul 2, 2002 4:26 pm 
Julian ElischerJul 2, 2002 4:35 pm 
Julian ElischerJul 2, 2002 4:54 pm 
Terry LambertJul 2, 2002 5:02 pm 
Terry LambertJul 2, 2002 5:05 pm 
Julian ElischerJul 2, 2002 5:50 pm 
Bruce EvansJul 2, 2002 11:57 pm 
Terry LambertJul 3, 2002 10:37 am 
Garance A DrosihnJul 3, 2002 10:46 am 
Neal FachanJul 3, 2002 1:46 pm.diff
Julian ElischerJul 3, 2002 4:04 pm 
Neal FachanJul 3, 2002 5:12 pm 
Daniel EischenJul 4, 2002 6:27 am 
Julian ElischerJul 4, 2002 8:36 am 
Daniel EischenJul 4, 2002 10:07 am 
Julian ElischerJul 4, 2002 10:33 am 
Daniel EischenJul 4, 2002 11:29 am 
Julian ElischerJul 4, 2002 11:40 am 
Daniel EischenJul 4, 2002 12:23 pm 
Subject:Re: additional queue macro
From:Bruce Evans (bd@zeta.org.au)
Date:Jul 2, 2002 11:57:29 pm
List:org.freebsd.freebsd-current

On Tue, 2 Jul 2002, Ian Dowse wrote:

In message <2002@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.

This would be clearer in all case :-). I think even the committer of the FOREACH macros thinks that they shouldn't be used if the list traversal has any surprises.

Bruce

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