Changeset 8321 in vbox
- Timestamp:
- Apr 23, 2008 9:53:40 AM (17 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/AutoLock.cpp
r8155 r8321 43 43 AssertRC (vrc); 44 44 45 mWriteLockThread = NIL_RT THREAD;45 mWriteLockThread = NIL_RTNATIVETHREAD; 46 46 47 47 mReadLockCount = 0; … … 76 76 77 77 RTCritSectEnter (&mCritSect); 78 bool locked = mWriteLockThread == RTThread Self();78 bool locked = mWriteLockThread == RTThreadNativeSelf(); 79 79 RTCritSectLeave (&mCritSect); 80 80 return locked; … … 94 94 RTCritSectEnter (&mCritSect); 95 95 96 if (mWriteLockThread != RTThread Self())97 { 98 if (mReadLockCount != 0 || mWriteLockThread != NIL_RT THREAD ||96 if (mWriteLockThread != RTThreadNativeSelf()) 97 { 98 if (mReadLockCount != 0 || mWriteLockThread != NIL_RTNATIVETHREAD || 99 99 mWriteLockPending != 0 /* respect other pending writers */) 100 100 { … … 109 109 110 110 Assert (mWriteLockLevel == 0); 111 Assert (mWriteLockThread == NIL_RT THREAD);112 113 mWriteLockThread = RTThread Self();111 Assert (mWriteLockThread == NIL_RTNATIVETHREAD); 112 113 mWriteLockThread = RTThreadNativeSelf(); 114 114 } 115 115 … … 139 139 if (mWriteLockLevel == 0) 140 140 { 141 mWriteLockThread = NIL_RT THREAD;141 mWriteLockThread = NIL_RTNATIVETHREAD; 142 142 143 143 /* no write locks, let writers go if there are any (top priority), … … 172 172 bool isFirstReadLock = mReadLockCount == 1; 173 173 174 if (isWriteLock && mWriteLockThread == RTThread Self())174 if (isWriteLock && mWriteLockThread == RTThreadNativeSelf()) 175 175 { 176 176 /* read lock nested into the write lock, cause return immediately */ … … 225 225 /* read unlock nested into the write lock, just decrease the 226 226 * counter */ 227 Assert (mWriteLockThread == RTThread Self()227 Assert (mWriteLockThread == RTThreadNativeSelf() 228 228 /* unlockRead() after lockWrite()? */); 229 if (mWriteLockThread == RTThread Self())229 if (mWriteLockThread == RTThreadNativeSelf()) 230 230 -- mReadLockCount; 231 231 } -
trunk/src/VBox/Main/include/AutoLock.h
r8155 r8321 191 191 RTSEMEVENTMULTI mGoReadSem; 192 192 193 RT THREAD mWriteLockThread;193 RTNATIVETHREAD mWriteLockThread; 194 194 195 195 uint32_t mReadLockCount;
Note:
See TracChangeset
for help on using the changeset viewer.