From owner-freebsd-current Tue Jul 2 8:13:10 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0043E37B400 for ; Tue, 2 Jul 2002 08:13:08 -0700 (PDT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id E316543E3B for ; Tue, 2 Jul 2002 08:13:07 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 2 Jul 2002 16:13:07 +0100 (BST) To: Jonathan Lemon Cc: current@freebsd.org Subject: Re: additional queue macro In-Reply-To: Your message of "Tue, 02 Jul 2002 09:54:02 CDT." <20020702095402.D1020@prism.flugsvamp.com> Date: Tue, 02 Jul 2002 16:13:06 +0100 From: Ian Dowse Message-ID: <200207021613.aa59595@salmon.maths.tcd.ie> 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 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