VirtualBox

Changeset 36522 in vbox for trunk/include/iprt/cpp


Ignore:
Timestamp:
Apr 4, 2011 12:26:39 PM (14 years ago)
Author:
vboxsync
Message:

lock.h: nit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cpp/lock.h

    r36521 r36522  
    128128{
    129129private:
     130    /** Reference to the lock we're holding. */
    130131    RTCLockMtx &m_rMtx;
    131     bool        mfLocked;
     132    /** Whether we're currently holding the lock of if it was already
     133     *  explictily released by the release() method. */
     134    bool        m_fLocked;
    132135
    133136public:
     
    136139    {
    137140        m_rMtx.lock();
    138         mfLocked = true;
     141        m_fLocked = true;
    139142    }
    140143
    141144    ~RTCLock()
    142145    {
    143         if (mfLocked)
     146        if (m_fLocked)
    144147            m_rMtx.unlock();
    145148    }
     
    147150    inline void release()
    148151    {
    149         if (mfLocked)
     152        if (m_fLocked)
    150153        {
    151154            m_rMtx.unlock();
    152             mfLocked = false;
     155            m_fLocked = false;
    153156        }
    154157    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette