Return-Path: X-Original-To: apmail-thrift-dev-archive@www.apache.org Delivered-To: apmail-thrift-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C82B2D4D8 for ; Wed, 7 Nov 2012 15:41:58 +0000 (UTC) Received: (qmail 11120 invoked by uid 500); 7 Nov 2012 15:41:58 -0000 Delivered-To: apmail-thrift-dev-archive@thrift.apache.org Received: (qmail 10755 invoked by uid 500); 7 Nov 2012 15:41:53 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 10697 invoked by uid 99); 7 Nov 2012 15:41:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 15:41:51 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ben.craig@ni.com designates 130.164.80.5 as permitted sender) Received: from [130.164.80.5] (HELO spamkiller05.natinst.com) (130.164.80.5) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 15:41:42 +0000 Received: from mailserv58-us.natinst.com (nb-hsrp-1338.natinst.com [130.164.19.133]) by spamkiller05.natinst.com (8.14.5/8.14.5) with ESMTP id qA7FfLJv011829; Wed, 7 Nov 2012 09:41:21 -0600 Received: from US-AUS-MAIL1.amer.corp.natinst.com ([130.164.14.197]) by mailserv58-us.natinst.com (Lotus Domino Release 8.5.3FP2 HF169) with ESMTP id 2012110709412156-1075815 ; Wed, 7 Nov 2012 09:41:21 -0600 In-Reply-To: References: To: dev@thrift.apache.org, user@thrift.apache.org MIME-Version: 1.0 Subject: Re: thrift/concurrency/Mutex.h bug X-KeepSent: 771CAAE1:BFF58DEC-86257AAF:0055FB89; type=4; flags=0; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.2FP4 November 18, 2011 From: Ben Craig Message-ID: Date: Wed, 7 Nov 2012 09:41:21 -0600 X-MIMETrack: Serialize by Router on US-AUS-MAIL1/AUS/M/NIC(Release 8.5.3FP2 HF169|September 14, 2012) at 11/07/2012 09:41:21 AM, Serialize complete at 11/07/2012 09:41:21 AM, Itemize by SMTP Server on MailServ58-US/AUS/H/NIC(Release 8.5.3FP2 HF169|September 14, 2012) at 11/07/2012 09:41:21 AM, Serialize by Router on MailServ58-US/AUS/H/NIC(Release 8.5.3FP2 HF169|September 14, 2012) at 11/07/2012 09:41:21 AM Content-Type: multipart/alternative; boundary="=_alternative 00562EDE86257AAF_=" X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.9.8185,1.0.431,0.0.0000 definitions=2012-11-06_05:2012-11-06,2012-11-06,1970-01-01 signatures=0 X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 00562EDE86257AAF_= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="ISO-8859-1" I can sympathize with the author of the offending #defines, as I've seen=20 the bug that he references a number of times. I think that "Guard" is too = generic to #define away though. If only compilers would actually warn=20 about the offending usage... From: Henrique Mendon=E7a To: user@thrift.apache.org Cc: dev@thrift.apache.org Date: 11/07/2012 04:24 AM Subject: Re: thrift/concurrency/Mutex.h bug Sent by: hmendonca@gmail.com Hi Bud, I wonder why we are not using boost mutex and scoped mutex instead but those two macros are probably not necessary anyways. Would you create a patch and copy/adapt those comments to the thrift Mutex classes themselves? Thank you! http://thrift.apache.org/docs/HowToContribute/ Henrique On 7 November 2012 00:19, Bud Bundy wrote: > Hi, > > I'm using version 0.9.0. The following code in=20 thrift/concurrency/Mutex.h > is causing me great headaches: > > // A little hack to prevent someone from trying to do "Guard(m);" > // Such a use is invalid because the temporary Guard object is > // destroyed at the end of the line, releasing the lock. > // Sorry for polluting the global namespace, but I think it's worth it. > #define Guard(m) incorrect=5Fuse=5Fof=5FGuard(m) > #define RWGuard(m) incorrect=5Fuse=5Fof=5FRWGuard(m) > > The global macro is interfering with another library I'm using that also > defines a Guard class within their own namespace. So, no, I don't think > it's worth it. I think it's a bug. I can patch the file by removing=20 those > two lines, but any way this can be fixed in the trunk? > > Thanks. > --=_alternative 00562EDE86257AAF_=--