Changeset 43479 in vbox for trunk/src/VBox
- Timestamp:
- Oct 1, 2012 9:07:25 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r43186 r43479 4571 4571 uint64_t uOld; 4572 4572 4573 for (MachinesOList::iterator it = m->allMachines.begin(); 4574 it != m->allMachines.end(); 4575 ++it) 4576 { 4577 const ComObjPtr<Machine> &pMachine = *it; 4578 4579 for (;;) 4580 { 4581 uOld = ASMAtomicReadU64(&pMachine->uRegistryNeedsSaving); 4582 if (!uOld) 4583 break; 4584 if (ASMAtomicCmpXchgU64(&pMachine->uRegistryNeedsSaving, 0, uOld)) 4585 break; 4586 ASMNopPause(); 4587 } 4588 if (uOld) 4589 { 4590 AutoCaller autoCaller(pMachine); 4591 if (FAILED(autoCaller.rc())) 4592 continue; 4593 /* object is already dead, no point in saving settings */ 4594 if (autoCaller.state() != Ready) 4595 continue; 4596 AutoWriteLock mlock(pMachine COMMA_LOCKVAL_SRC_POS); 4597 rc = pMachine->saveSettings(&fNeedsGlobalSettings, 4598 Machine::SaveS_Force); // caller said save, so stop arguing 4573 { 4574 AutoReadLock alock(m->allMachines.getLockHandle() COMMA_LOCKVAL_SRC_POS); 4575 for (MachinesOList::iterator it = m->allMachines.begin(); 4576 it != m->allMachines.end(); 4577 ++it) 4578 { 4579 const ComObjPtr<Machine> &pMachine = *it; 4580 4581 for (;;) 4582 { 4583 uOld = ASMAtomicReadU64(&pMachine->uRegistryNeedsSaving); 4584 if (!uOld) 4585 break; 4586 if (ASMAtomicCmpXchgU64(&pMachine->uRegistryNeedsSaving, 0, uOld)) 4587 break; 4588 ASMNopPause(); 4589 } 4590 if (uOld) 4591 { 4592 AutoCaller autoCaller(pMachine); 4593 if (FAILED(autoCaller.rc())) 4594 continue; 4595 /* object is already dead, no point in saving settings */ 4596 if (autoCaller.state() != Ready) 4597 continue; 4598 AutoWriteLock mlock(pMachine COMMA_LOCKVAL_SRC_POS); 4599 rc = pMachine->saveSettings(&fNeedsGlobalSettings, 4600 Machine::SaveS_Force); // caller said save, so stop arguing 4601 } 4599 4602 } 4600 4603 }
Note:
See TracChangeset
for help on using the changeset viewer.