VirtualBox

Changeset 25836 in vbox


Ignore:
Timestamp:
Jan 14, 2010 4:44:46 PM (15 years ago)
Author:
vboxsync
Message:

Main: locking order fixes; GUI comes up now with strict locking enabled

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/AutoLock.h

    r25834 r25836  
    6666    LOCKCLASS_USBPROXYSERVICE = 3,          // USB proxy service object lock
    6767    LOCKCLASS_HOSTOBJECT = 4,               // Host object lock
    68     LOCKCLASS_HOSTLIST = 5,                 // lock protecting a list in Host object
    69     LOCKCLASS_OTHEROBJECT = 6,              // any regular object member variable lock
    70     LOCKCLASS_OTHERLIST = 7,                // lock protecting a list that's elsewhere
     68    LOCKCLASS_OTHEROBJECT = 5,              // any regular object member variable lock
     69    LOCKCLASS_OTHERLIST = 6,                // lock protecting a list that's elsewhere
    7170                                            // (e.g. snapshots list in machine object)
    72     LOCKCLASS_OBJECTSTATE = 8               // object state lock (handled by AutoCaller classes)
     71    LOCKCLASS_SNAPSHOTOBJECT = 7,           // snapshot object locks (need to have lower order
     72                                            // than both OTHEROBJECT and OTHERLIST since the list
     73                                            // of snapshots in Machine is OTHERLIST)
     74    LOCKCLASS_USBLIST = 8,                  // temporary hack to avoid having to clean up the USB filters
     75                                            // too much @todo r=dj get rid of this!
     76    LOCKCLASS_OBJECTSTATE = 9               // object state lock (handled by AutoCaller classes)
    7377};
    7478
  • trunk/src/VBox/Main/HostImpl.cpp

    r25834 r25836  
    152152    Data()
    153153#ifdef VBOX_WITH_USB
    154         : usbListsLock(LOCKCLASS_HOSTLIST)
     154        : usbListsLock(LOCKCLASS_USBLIST)
    155155#endif
    156156    {};
  • trunk/src/VBox/Main/MediumImpl.cpp

    r25443 r25836  
    16571657        if (FAILED(autoCaller.rc())) return autoCaller.rc();
    16581658
    1659         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1660 
    16611659        /* we access mParent */
    16621660        AutoReadLock treeLock(m->pVirtualBox->hardDiskTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
     1661
     1662        AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    16631663
    16641664        if (m->pParent.isNull())
     
    30083008    AssertComRCReturn(autoCaller.rc(), false);
    30093009
    3010     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    3011 
    30123010    /* we access children */
    30133011    AutoReadLock treeLock(m->pVirtualBox->hardDiskTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
     3012
     3013    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    30143014
    30153015    switch (m->type)
  • trunk/src/VBox/Main/glue/AutoLock.cpp

    r25834 r25836  
    7474        { LOCKCLASS_USBPROXYSERVICE,  "3-USBPROXYSERVICE" },
    7575        { LOCKCLASS_HOSTOBJECT,       "4-HOSTOBJECT" },
    76         { LOCKCLASS_HOSTLIST,         "5-HOSTLIST" },
    77         { LOCKCLASS_OTHEROBJECT,      "6-OTHEROBJECT" },
    78         { LOCKCLASS_OTHERLIST,        "7-OTHERLIST" },
    79         { LOCKCLASS_OBJECTSTATE,      "8-OBJECTSTATE" }
     76        { LOCKCLASS_OTHEROBJECT,      "5-OTHEROBJECT" },
     77        { LOCKCLASS_OTHERLIST,        "6-OTHERLIST" },
     78        { LOCKCLASS_SNAPSHOTOBJECT,   "7-SNAPSHOTOBJECT" },
     79        { LOCKCLASS_USBLIST,          "8-USBLIST" },
     80        { LOCKCLASS_OBJECTSTATE,      "9-OBJECTSTATE" }
    8081    };
    8182
  • trunk/src/VBox/Main/include/SnapshotImpl.h

    r25834 r25836  
    9191    // public methods only for internal purposes
    9292
    93 
    9493    /**
    9594     * Simple run-time type identification without having to enable C++ RTTI.
     
    10099    {
    101100        return clsidSnapshot;
     101    }
     102
     103    /**
     104     * Override of the default locking class to be used for validating lock
     105     * order with the standard member lock handle.
     106     */
     107    virtual VBoxLockingClass getLockingClass() const
     108    {
     109        return LOCKCLASS_SNAPSHOTOBJECT;
    102110    }
    103111
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette