From: Roger Meier Date: Wed, 7 Nov 2012 20:26:03 +0000 (+0000) Subject: THRIFT-1748 Guard and RWGuard macros defined in global namespace X-Git-Tag: 0.9.1~242 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=0069a4464012172f07b5f56064ed9ae6b79f9c52;p=common%2Fthrift.git THRIFT-1748 Guard and RWGuard macros defined in global namespace Patch: Bud Bundy git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1406793 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/cpp/src/thrift/concurrency/Mutex.h b/lib/cpp/src/thrift/concurrency/Mutex.h index 1763b5c6..3cd84408 100644 --- a/lib/cpp/src/thrift/concurrency/Mutex.h +++ b/lib/cpp/src/thrift/concurrency/Mutex.h @@ -183,15 +183,6 @@ class RWGuard : boost::noncopyable { const ReadWriteMutex& rw_mutex_; }; - -// 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) - - }}} // apache::thrift::concurrency #endif // #ifndef _THRIFT_CONCURRENCY_MUTEX_H_