Changeset 25834 in vbox for trunk/include/VBox/com
- Timestamp:
- Jan 14, 2010 4:21:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/AutoLock.h
r25813 r25834 27 27 // macros for automatic lock validation; these will amount to nothing 28 28 // 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 30 31 # define COMMA_LOCKVAL_SRC_POS , RT_SRC_POS 31 32 # define LOCKVAL_SRC_POS_DECL RT_SRC_POS_DECL … … 57 58 * LockHandle classes. 58 59 */ 59 enum MainLockValidationClasses60 enum VBoxLockingClass 60 61 { 61 62 LOCKCLASS_NONE = 0, … … 63 64 LOCKCLASS_VIRTUALBOXLIST = 2, // lock protecting a list in VirtualBox object 64 65 // (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 66 71 // (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) 69 73 }; 70 74 … … 111 115 virtual void unlockRead() = 0; 112 116 113 #ifdef RT_LOCK_STRICT117 #ifdef VBOX_WITH_MAIN_LOCK_VALIDATION 114 118 virtual const char* describe() const = 0; 115 119 #endif … … 132 136 { 133 137 public: 134 RWLockHandle( MainLockValidationClasses lockClass);138 RWLockHandle(VBoxLockingClass lockClass); 135 139 virtual ~RWLockHandle(); 136 140 … … 144 148 virtual uint32_t writeLockLevel() const; 145 149 146 #ifdef RT_LOCK_STRICT150 #ifdef VBOX_WITH_MAIN_LOCK_VALIDATION 147 151 virtual const char* describe() const; 148 152 #endif … … 169 173 { 170 174 public: 171 WriteLockHandle( MainLockValidationClasses lockClass);175 WriteLockHandle(VBoxLockingClass lockClass); 172 176 virtual ~WriteLockHandle(); 173 177 virtual bool isWriteLockOnCurrentThread() const; … … 179 183 virtual uint32_t writeLockLevel() const; 180 184 181 #ifdef RT_LOCK_STRICT185 #ifdef VBOX_WITH_MAIN_LOCK_VALIDATION 182 186 virtual const char* describe() const; 183 187 #endif
Note:
See TracChangeset
for help on using the changeset viewer.