From owner-freebsd-current@FreeBSD.ORG Tue Apr 7 14:29:03 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7555510656F1 for ; Tue, 7 Apr 2009 14:29:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BDE028FC19 for ; Tue, 7 Apr 2009 14:29:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id C659346BC6; Tue, 7 Apr 2009 10:29:01 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id B1F7A8A03E; Tue, 7 Apr 2009 10:29:00 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Tue, 7 Apr 2009 10:24:07 -0400 User-Agent: KMail/1.9.7 References: <20090406083238.GB3358@onelab2.iet.unipi.it> In-Reply-To: <20090406083238.GB3358@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904071024.07805.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 07 Apr 2009 10:29:00 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=4.2 tests=RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Luigi Rizzo Subject: Re: missing atomic_exchg_*() in the atomic.h API ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 14:29:04 -0000 On Monday 06 April 2009 4:32:38 am Luigi Rizzo wrote: > while looking at the functions in atomic.h i noticed that > there seems to be no atomic_exchg_*() in the API, though this > is a supported function in most/all supported archiectures, > and a useful function. We do have atomic_readandclear() which > uses the same underlying CPU instruction. > > Again, any objection if i add it ? Mostly b/c there hasn't been a need for it to date. I would probably spell out 'exchange' btw. -- John Baldwin