[
https://issues.apache.org/jira/browse/THRIFT-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706682#action_12706682
]
David Reiss commented on THRIFT-490:
------------------------------------
I guess it's a good thing I added the macros. :)
> What are the intended uses for Guard and RWGuard (defined in Mutex.h)
> ---------------------------------------------------------------------
>
> Key: THRIFT-490
> URL: https://issues.apache.org/jira/browse/THRIFT-490
> Project: Thrift
> Issue Type: Question
> Components: Library (C++)
> Affects Versions: 0.1
> Environment: Mac OS X 10.5.6
> Reporter: Rush Manbert
> Fix For: 0.2
>
> Attachments:
> 0001-THRIFT-490.-Clarify-the-comment-for-the-Guard-macro.patch
>
>
> The Guard and RWGuard classes are defined much like the Synchronized class,
> but there are also two macros defined, Guard(m) and RWGuard(m) which cause a
> compile error if you try to declare a Guard or RWGuard on the stack.
> To me, these look like scoped mutex locks that would be used like this:
> {
> Guard g(myMutex);
> }
> which is again just like the use of Synchronized.
> Have I missed something? What is the intended usage for these classes? I need
> to know because I'm writing tests for them so I can test my Boost Mutex and
> ReadWriteMutex implementations.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.