Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

VirtualBoxBaseProto::AutoInitSpan::AutoInitSpan ( VirtualBoxBaseProto aObj,
Result  aResult = Failed 

Creates a smart initialization span object that places the object to InInit state.

Please see the AutoInitSpan class description for more info.

aObj |this| pointer of the managed VirtualBoxBase object whose init() method is being called.
aResult Default initialization result.

Definition at line 302 of file VirtualBoxBase.cpp.

References Assert, AssertReturnVoid, VirtualBoxBaseProto::mState, VirtualBoxBaseProto::mStateLock, and VirtualBoxBaseProto::setState().

    : mObj (aObj), mResult (aResult), mOk (false)
    Assert (aObj);

    AutoWriteLock stateLock (mObj->mStateLock);

    mOk = mObj->mState == NotReady;
    AssertReturnVoid (mOk);

    mObj->setState (InInit);

Generated by  Doxygen 1.6.0   Back to index