Changeset 25614 in vbox for trunk/src/VBox/Runtime/r3/win
- Timestamp:
- Jan 1, 2010 2:19:06 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56305
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/semmutex-win.cpp
r25607 r25614 151 151 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, VERR_INVALID_HANDLE); 152 152 153 #ifdef RTSEMMUTEX_STRICT154 RTTHREAD hThreadSelf = RTThreadSelfAutoAdopt();155 RTLockValidatorCheckOrder(&pThis->ValidatorRec, hThreadSelf, pSrcPos);156 #else157 RTTHREAD hThreadSelf = RTThreadSelf();158 #endif159 160 153 /* 161 154 * Lock mutex semaphore. 162 155 */ 156 RTTHREAD hThreadSelf = NIL_RTTHREAD; 163 157 if (cMillies > 0) 164 158 { 165 159 #ifdef RTSEMMUTEX_STRICT 166 int rc9 = RTLockValidatorCheckBlocking(&pThis->ValidatorRec, hThreadSelf,167 RTTHREADSTATE_MUTEX, true, pSrcPos);160 hThreadSelf = RTThreadSelfAutoAdopt(); 161 int rc9 = RTLockValidatorRecExclCheckOrderAndBlocking(&pThis->ValidatorRec, hThreadSelf, pSrcPos, true); 168 162 if (RT_FAILURE(rc9)) 169 163 return rc9; 164 #else 165 hThreadSelf = RTThreadSelf(); 170 166 #endif 171 167 RTThreadBlocking(hThreadSelf, RTTHREADSTATE_MUTEX); … … 179 175 case WAIT_OBJECT_0: 180 176 #ifdef RTSEMMUTEX_STRICT 181 RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, pSrcPos); 182 #endif 177 RTLockValidatorRecExclSetOwner(&pThis->ValidatorRec, hThreadSelf, pSrcPos, false /* we don't know */); 178 #endif 179 /** @todo record who owns this thing and avoid kernel calls during recursion. */ 183 180 return VINF_SUCCESS; 184 181 … … 227 224 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, VERR_INVALID_HANDLE); 228 225 226 #ifdef RTSEMMUTEX_STRICT 227 int rc9 = RTLockValidatorRecExclReleaseOwner(&pThis->ValidatorRec, false); 228 if (RT_FAILURE(rc9)) 229 return rc9; 230 #endif 231 229 232 /* 230 233 * Unlock mutex semaphore. 231 234 */ 232 #ifdef RTSEMMUTEX_STRICT233 if ( pThis->ValidatorRec.hThread != NIL_RTTHREAD234 && pThis->ValidatorRec.hThread == RTThreadSelf())235 RTLockValidatorUnsetOwner(&pThis->ValidatorRec);236 else237 AssertMsgFailed(("%p hThread=%RTthrd\n", pThis, pThis->ValidatorRec.hThread));238 #endif239 235 if (ReleaseMutex(pThis->hMtx)) 240 236 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.