You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "David Reiss (JIRA)" <ji...@apache.org> on 2009/05/07 01:20:30 UTC

[jira] Updated: (THRIFT-490) What are the intended uses for Guard and RWGuard (defined in Mutex.h)

     [ https://issues.apache.org/jira/browse/THRIFT-490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Reiss updated THRIFT-490:
-------------------------------

    Attachment: 0001-THRIFT-490.-Clarify-the-comment-for-the-Guard-macro.patch

> 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
>         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.