Changeset 6748 in vbox
- Timestamp:
- Feb 2, 2008 1:10:56 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 27830
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp
r6747 r6748 148 148 */ 149 149 struct RTSEMMUTEXINTERNAL *pThis = MutexSem; 150 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 151 AssertMsgReturn(pThis->iMagic == RTSEMMUTEX_MAGIC, 152 ("MutexSem=%p iMagic=%#x\n", pThis, pThis->iMagic), 153 VERR_INVALID_HANDLE); 150 AssertReturn(VALID_PTR(pThis) && pThis->iMagic == RTSEMMUTEX_MAGIC, 151 VERR_INVALID_HANDLE); 154 152 155 153 /* … … 178 176 /* 179 177 * Lock the mutex. 178 * Optimize for the uncontended case (makes 1-2 ns difference). 180 179 */ 181 180 if (RT_UNLIKELY(!ASMAtomicCmpXchgS32(&pThis->iState, 1, 0))) … … 225 224 /* 226 225 * When leaving this loop, iState is set to 2. This means that we gained the 227 * Lock and there are _possibly_ some waiters. We don't know exactly as another226 * lock and there are _possibly_ some waiters. We don't know exactly as another 228 227 * thread might entered this loop at nearly the same time. Therefore we will 229 228 * call futex_wakeup once too often (if _no_ other thread entered this loop). … … 262 261 */ 263 262 struct RTSEMMUTEXINTERNAL *pThis = MutexSem; 264 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 265 AssertMsgReturn(pThis->iMagic == RTSEMMUTEX_MAGIC, 266 ("MutexSem=%p iMagic=%#x\n", pThis, pThis->iMagic), 267 VERR_INVALID_HANDLE); 263 AssertReturn(VALID_PTR(pThis) && pThis->iMagic == RTSEMMUTEX_MAGIC, 264 VERR_INVALID_HANDLE); 268 265 269 266 /* … … 298 295 */ 299 296 int32_t iNew = ASMAtomicDecS32(&pThis->iState); 300 if ( iNew != 0)297 if (RT_UNLIKELY(iNew != 0)) 301 298 { 302 299 /* somebody is waiting, try wake up one of them. */
Note:
See TracChangeset
for help on using the changeset viewer.