VirtualBox

Changeset 25834 in vbox for trunk/include/VBox/com


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

Main: finish integration of Main lock validation with IPRT; only enabled with VBOX_WITH_STRICT_LOCKS=1 (do NOT enable unless you want Main to stop working now)

File:
1 edited

Legend:

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

    r25813 r25834  
    2727// macros for automatic lock validation; these will amount to nothing
    2828// unless lock validation is enabled for the runtime
    29 #if defined(RT_LOCK_STRICT)
     29#if defined(RT_LOCK_STRICT) && defined (DEBUG)
     30#define VBOX_WITH_MAIN_LOCK_VALIDATION
    3031# define COMMA_LOCKVAL_SRC_POS , RT_SRC_POS
    3132# define LOCKVAL_SRC_POS_DECL RT_SRC_POS_DECL
     
    5758 * LockHandle classes.
    5859 */
    59 enum MainLockValidationClasses
     60enum VBoxLockingClass
    6061{
    6162    LOCKCLASS_NONE = 0,
     
    6364    LOCKCLASS_VIRTUALBOXLIST = 2,           // lock protecting a list in VirtualBox object
    6465                                            // (machines list, hard disk tree, shared folders list, ...)
    65     LOCKCLASS_OTHERLIST = 3,                // lock protecting a list that's elsewhere
     66    LOCKCLASS_USBPROXYSERVICE = 3,          // USB proxy service object lock
     67    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
    6671                                            // (e.g. snapshots list in machine object)
    67     LOCKCLASS_OBJECT = 4,                   // any regular object member variable  lock
    68     LOCKCLASS_OBJECTSTATE = 5               // object state lock (handled by AutoCaller classes)
     72    LOCKCLASS_OBJECTSTATE = 8               // object state lock (handled by AutoCaller classes)
    6973};
    7074
     
    111115    virtual void unlockRead() = 0;
    112116
    113 #ifdef RT_LOCK_STRICT
     117#ifdef VBOX_WITH_MAIN_LOCK_VALIDATION
    114118    virtual const char* describe() const = 0;
    115119#endif
     
    132136{
    133137public:
    134     RWLockHandle(MainLockValidationClasses lockClass);
     138    RWLockHandle(VBoxLockingClass lockClass);
    135139    virtual ~RWLockHandle();
    136140
     
    144148    virtual uint32_t writeLockLevel() const;
    145149
    146 #ifdef RT_LOCK_STRICT
     150#ifdef VBOX_WITH_MAIN_LOCK_VALIDATION
    147151    virtual const char* describe() const;
    148152#endif
     
    169173{
    170174public:
    171     WriteLockHandle(MainLockValidationClasses lockClass);
     175    WriteLockHandle(VBoxLockingClass lockClass);
    172176    virtual ~WriteLockHandle();
    173177    virtual bool isWriteLockOnCurrentThread() const;
     
    179183    virtual uint32_t writeLockLevel() const;
    180184
    181 #ifdef RT_LOCK_STRICT
     185#ifdef VBOX_WITH_MAIN_LOCK_VALIDATION
    182186    virtual const char* describe() const;
    183187#endif
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