SolarMutexTryAndBuyGuard

Stephan Bergmann sbergman at redhat.com
Sun Sep 28 23:48:57 PDT 2014


On 09/27/2014 08:44 PM, Michael Stahl wrote:
> On 27/09/14 15:10, Miklos Vajna wrote:
>> On Fri, Sep 26, 2014 at 02:33:38PM -0700, Michael Stahl <mstahl at redhat.com> wrote:
>>> +class SolarMutexTryAndBuyGuard
>>> +    : private boost::noncopyable
>>> +{
>>> +    private:
>>> +        bool m_isAcquired;
>>> +#if OSL_DEBUG_LEVEL > 0
>>> +        bool m_isChecked;
>>> +#endif
>>
>> Isn't this exactly the situation when we should use DBG_UTIL and not
>> OSL_DEBUG_LEVEL -- i.e. when the conditional part results in a different
>> class layout?
>
> in general, you are of course right.
>
> but this all-inline guard class can only sensibly be used within a
> single function, with the life time limited to a single stack frame;
> this should imply that the situation where multiple compilation units
> built with different OSL_DEBUG_LEVEL access the same instance with
> different layout cannot happen.

ODR violators will be prosecuted.

Stephan


More information about the LibreOffice mailing list