Changeset 8665 in vbox for trunk/src/VBox/Main/VirtualBoxBase.cpp
- Timestamp:
- May 7, 2008 3:23:25 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/VirtualBoxBase.cpp
r8155 r8665 66 66 RWLockHandle *VirtualBoxBaseNEXT_base::lockHandle() const 67 67 { 68 /* lasy initialization */ 69 if (!mObjectLock) 70 mObjectLock = new RWLockHandle; 68 /* lazy initialization */ 69 if (RT_UNLIKELY(!mObjectLock)) 70 { 71 AssertCompile (sizeof (RWLockHandle *) == sizeof (void *)); 72 RWLockHandle *objLock = new RWLockHandle; 73 if (!ASMAtomicCmpXchgPtr ((void * volatile *) &mObjectLock, objLock, NULL)) 74 { 75 delete objLock; 76 objLock = (RWLockHandle *) ASMAtomicReadPtr ((void * volatile *) &mObjectLock); 77 } 78 return objLock; 79 } 71 80 return mObjectLock; 72 81 }
Note:
See TracChangeset
for help on using the changeset viewer.