Changeset 8726 in vbox
- Timestamp:
- May 8, 2008 7:48:48 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 30675
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/AutoLock.cpp
r8664 r8726 291 291 RTCritSectEnter (&mCritSect); 292 292 293 RTNATIVETHREAD threadSelf = RTThreadNativeSelf(); 294 293 295 Assert (mWriteLockLevel != 0 /* unlockWrite() w/o preceding lockWrite()? */); 294 296 if (mWriteLockLevel != 0) 295 297 { 296 -- mWriteLockLevel; 297 if (mWriteLockLevel == 0) 298 { 299 Assert (mSelfReadLockCount == 0 300 /* mixed unlockWrite()/unlockRead() order? */); 301 302 mWriteLockThread = NIL_RTNATIVETHREAD; 303 304 /* no write locks, let writers go if there are any (top priority), 305 * otherwise let readers go if there are any */ 306 if (mWriteLockPending != 0) 307 RTSemEventSignal (mGoWriteSem); 308 else if (mReadLockCount != 0) 309 RTSemEventMultiSignal (mGoReadSem); 298 Assert (mWriteLockThread == threadSelf 299 /* unlockWrite() w/o preceding lockWrite()? */); 300 if (mWriteLockThread == threadSelf) 301 { 302 -- mWriteLockLevel; 303 if (mWriteLockLevel == 0) 304 { 305 Assert (mSelfReadLockCount == 0 306 /* mixed unlockWrite()/unlockRead() order? */); 307 308 mWriteLockThread = NIL_RTNATIVETHREAD; 309 310 /* no write locks, let writers go if there are any (top priority), 311 * otherwise let readers go if there are any */ 312 if (mWriteLockPending != 0) 313 RTSemEventSignal (mGoWriteSem); 314 else if (mReadLockCount != 0) 315 RTSemEventMultiSignal (mGoReadSem); 310 316 311 317 # ifdef DEBUG 312 RTTHREAD iprtThreadSelf = RTThreadSelf(); 313 if (iprtThreadSelf != NIL_RTTHREAD) 314 RTThreadWriteLockDec (iprtThreadSelf); 315 # endif 318 RTTHREAD iprtThreadSelf = RTThreadSelf(); 319 if (iprtThreadSelf != NIL_RTTHREAD) 320 RTThreadWriteLockDec (iprtThreadSelf); 321 # endif 322 } 316 323 } 317 324 }
Note:
See TracChangeset
for help on using the changeset viewer.