Changeset 36522 in vbox for trunk/include/iprt/cpp
- Timestamp:
- Apr 4, 2011 12:26:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/lock.h
r36521 r36522 128 128 { 129 129 private: 130 /** Reference to the lock we're holding. */ 130 131 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; 132 135 133 136 public: … … 136 139 { 137 140 m_rMtx.lock(); 138 m fLocked = true;141 m_fLocked = true; 139 142 } 140 143 141 144 ~RTCLock() 142 145 { 143 if (m fLocked)146 if (m_fLocked) 144 147 m_rMtx.unlock(); 145 148 } … … 147 150 inline void release() 148 151 { 149 if (m fLocked)152 if (m_fLocked) 150 153 { 151 154 m_rMtx.unlock(); 152 m fLocked = false;155 m_fLocked = false; 153 156 } 154 157 }
Note:
See TracChangeset
for help on using the changeset viewer.