Changeset 75660 in vbox for trunk/src/VBox/Main/src-all
- Timestamp:
- Nov 22, 2018 12:20:52 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-all/AutoCaller.cpp
r69500 r75660 313 313 } 314 314 315 ObjectState::State ObjectState::autoUninitSpanConstructor( )315 ObjectState::State ObjectState::autoUninitSpanConstructor(bool fTry) 316 316 { 317 317 AutoWriteLock stateLock(mStateLock COMMA_LOCKVAL_SRC_POS); … … 330 330 * returns, the object state is well-defined (NotReady). */ 331 331 332 if (fTry) 333 return Ready; 334 332 335 /* lazy semaphore creation */ 333 336 if (mInitUninitSem == NIL_RTSEMEVENTMULTI) … … 361 364 if (mCallers > 0) 362 365 { 366 if (fTry) 367 return Ready; 368 363 369 /* lazy creation */ 364 370 Assert(mZeroCallersSem == NIL_RTSEMEVENT); … … 518 524 * @param aObj |this| pointer of the VirtualBoxBase object whose uninit() 519 525 * method is being called. 520 */ 521 AutoUninitSpan::AutoUninitSpan(VirtualBoxBase *aObj) 526 * @param fTry @c true if the wait for other callers should be skipped, 527 * requiring checking if the uninit span is actually operational. 528 */ 529 AutoUninitSpan::AutoUninitSpan(VirtualBoxBase *aObj, bool fTry /* = false */) 522 530 : mObj(aObj), 523 531 mInitFailed(false), 524 mUninitDone(false) 532 mUninitDone(false), 533 mUninitFailed(false) 525 534 { 526 535 Assert(mObj); 527 536 ObjectState::State state; 528 state = mObj->getObjectState().autoUninitSpanConstructor( );537 state = mObj->getObjectState().autoUninitSpanConstructor(fTry); 529 538 if (state == ObjectState::InitFailed) 530 539 mInitFailed = true; 531 540 else if (state == ObjectState::NotReady) 532 541 mUninitDone = true; 542 else if (state == ObjectState::Ready) 543 mUninitFailed = true; 533 544 } 534 545 … … 539 550 { 540 551 /* do nothing if already uninitialized */ 541 if (mUninitDone )552 if (mUninitDone || mUninitFailed) 542 553 return; 543 554 … … 553 564 { 554 565 /* do nothing if already uninitialized */ 555 if (mUninitDone )566 if (mUninitDone || mUninitFailed) 556 567 return; 557 568
Note:
See TracChangeset
for help on using the changeset viewer.