Changeset 25906 in vbox
- Timestamp:
- Jan 18, 2010 6:33:04 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56722
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/AutoLock.h
r25885 r25906 397 397 * 398 398 * In addition to utility methods for subclasses, this implements the public 399 * leave/enter /maybeEntermethods, which are common to all399 * leave/enter methods, which are common to all 400 400 * write locks. 401 401 */ … … 426 426 void leave(); 427 427 void enter(); 428 void maybeEnter();429 428 }; 430 429 -
trunk/src/VBox/Main/glue/AutoLock.cpp
r25890 r25906 624 624 } 625 625 626 /**627 * Same as #enter() but checks if the current thread actally owns the lock628 * and only proceeds if not. As a result, as opposed to #enter(), doesn't629 * assert when called with the lock already being held.630 */631 void AutoWriteLockBase::maybeEnter()632 {633 uint32_t i = 0;634 for (HandlesVector::iterator it = m->aHandles.begin();635 it != m->aHandles.end();636 ++it)637 {638 LockHandle *pHandle = *it;639 if (pHandle)640 {641 if (!pHandle->isWriteLockOnCurrentThread())642 {643 for (; m->acUnlockedInLeave[i]; --m->acUnlockedInLeave[i])644 callLockImpl(*pHandle);645 }646 }647 ++i;648 }649 }650 651 626 //////////////////////////////////////////////////////////////////////////////// 652 627 //
Note:
See TracChangeset
for help on using the changeset viewer.