thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Craig <ben.cr...@ni.com>
Subject Re: thrift/concurrency/Mutex.h bug
Date Wed, 07 Nov 2012 15:41:21 GMT
I can sympathize with the author of the offending #defines, as I've seen 
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 
about the offending usage...



From:   Henrique Mendonça <henrique@apache.org>
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 <budric@gmail.com> wrote:

> Hi,
>
> I'm using version 0.9.0.  The following code in 
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_use_of_Guard(m)
> #define RWGuard(m) incorrect_use_of_RWGuard(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 
those
> two lines, but any way this can be fixed in the trunk?
>
> Thanks.
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message