From: David Reiss Date: Thu, 7 May 2009 00:41:18 +0000 (+0000) Subject: THRIFT-490. Clarify the comment for the Guard macro X-Git-Tag: 0.2.0~118 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=be378f232b3b4ea5007a6665d3815a63a10ece65;p=common%2Fthrift.git THRIFT-490. Clarify the comment for the Guard macro git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@772478 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/cpp/src/concurrency/Mutex.h b/lib/cpp/src/concurrency/Mutex.h index 884412be..73c73e0e 100644 --- a/lib/cpp/src/concurrency/Mutex.h +++ b/lib/cpp/src/concurrency/Mutex.h @@ -102,6 +102,8 @@ class RWGuard { // A little hack to prevent someone from trying to do "Guard(m);" +// Such a use is invalid because the temporary Guard object is +// destoryed 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)