Changeset 58829 in vbox
- Timestamp:
- Nov 23, 2015 5:13:18 PM (9 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r58758 r58829 1197 1197 generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp \ 1198 1198 generic/sched-generic.cpp \ 1199 generic/semrw-$(if-expr defined(VBOX_WITH_LOCKLESS_SEMRW), ockless-,)generic.cpp \1199 generic/semrw-$(if-expr defined(VBOX_WITH_LOCKLESS_SEMRW),lockless-,)generic.cpp \ 1200 1200 generic/timer-generic.cpp \ 1201 1201 generic/utf16locale-generic.cpp \ … … 1755 1755 generic/RTAssertShouldPanic-generic.cpp \ 1756 1756 generic/critsect-generic.cpp \ 1757 generic/critsectrw-generic.cpp \ 1757 1758 \ 1758 1759 $(RuntimeNoCrt_SOURCES) -
trunk/src/VBox/Runtime/generic/critsectrw-generic.cpp
r57358 r58829 67 67 pThis->u32Magic = RTCRITSECTRW_MAGIC_DEAD; 68 68 pThis->fNeedReset = false; 69 #ifdef IN_RING0 70 pThis->fFlags = (uint16_t)(fFlags | RTCRITSECT_FLAGS_RING0); 71 #else 72 pThis->fFlags = (uint16_t)(fFlags & ~RTCRITSECT_FLAGS_RING0); 73 #endif 69 74 pThis->u64State = 0; 70 75 pThis->hNativeWriter = NIL_RTNATIVETHREAD; … … 138 143 AssertPtrReturn(pThis, RTLOCKVAL_SUB_CLASS_INVALID); 139 144 AssertReturn(pThis->u32Magic == RTCRITSECTRW_MAGIC, RTLOCKVAL_SUB_CLASS_INVALID); 145 #ifdef IN_RING0 146 Assert(pThis->fFlags & RTCRITSECT_FLAGS_RING0); 147 #else 148 Assert(!(pThis->fFlags & RTCRITSECT_FLAGS_RING0)); 149 #endif 140 150 #ifdef RTCRITSECTRW_STRICT 141 151 AssertReturn(!(pThis->fFlags & RTCRITSECT_FLAGS_NOP), RTLOCKVAL_SUB_CLASS_INVALID); … … 158 168 AssertPtr(pThis); 159 169 AssertReturn(pThis->u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED); 170 #ifdef IN_RING0 171 Assert(pThis->fFlags & RTCRITSECT_FLAGS_RING0); 172 #else 173 Assert(!(pThis->fFlags & RTCRITSECT_FLAGS_RING0)); 174 #endif 160 175 161 176 #ifdef RTCRITSECTRW_STRICT … … 257 272 RT_INDEFINITE_WAIT, RTTHREADSTATE_RW_READ, false); 258 273 if (RT_SUCCESS(rc)) 259 #el se274 #elif defined(IN_RING3) 260 275 RTTHREAD hThreadSelf = RTThreadSelf(); 261 276 RTThreadBlocking(hThreadSelf, RTTHREADSTATE_RW_READ, false); … … 263 278 { 264 279 rc = RTSemEventMultiWait(pThis->hEvtRead, RT_INDEFINITE_WAIT); 280 #ifdef IN_RING3 265 281 RTThreadUnblocked(hThreadSelf, RTTHREADSTATE_RW_READ); 282 #endif 266 283 if (pThis->u32Magic != RTCRITSECTRW_MAGIC) 267 284 return VERR_SEM_DESTROYED; … … 388 405 AssertPtr(pThis); 389 406 AssertReturn(pThis->u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED); 407 #ifdef IN_RING0 408 Assert(pThis->fFlags & RTCRITSECT_FLAGS_RING0); 409 #else 410 Assert(!(pThis->fFlags & RTCRITSECT_FLAGS_RING0)); 411 #endif 390 412 391 413 /* … … 461 483 AssertPtr(pThis); 462 484 AssertReturn(pThis->u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED); 485 #ifdef IN_RING0 486 Assert(pThis->fFlags & RTCRITSECT_FLAGS_RING0); 487 #else 488 Assert(!(pThis->fFlags & RTCRITSECT_FLAGS_RING0)); 489 #endif 463 490 464 491 #ifdef RTCRITSECTRW_STRICT … … 584 611 RT_INDEFINITE_WAIT, RTTHREADSTATE_RW_WRITE, false); 585 612 if (RT_SUCCESS(rc)) 586 #el se613 #elif defined(IN_RING3) 587 614 RTTHREAD hThreadSelf = RTThreadSelf(); 588 615 RTThreadBlocking(hThreadSelf, RTTHREADSTATE_RW_WRITE, false); … … 590 617 { 591 618 rc = RTSemEventWait(pThis->hEvtWrite, RT_INDEFINITE_WAIT); 619 #ifdef IN_RING3 592 620 RTThreadUnblocked(hThreadSelf, RTTHREADSTATE_RW_WRITE); 621 #endif 593 622 if (pThis->u32Magic != RTCRITSECTRW_MAGIC) 594 623 return VERR_SEM_DESTROYED; … … 682 711 AssertPtr(pThis); 683 712 AssertReturn(pThis->u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED); 713 #ifdef IN_RING0 714 Assert(pThis->fFlags & RTCRITSECT_FLAGS_RING0); 715 #else 716 Assert(!(pThis->fFlags & RTCRITSECT_FLAGS_RING0)); 717 #endif 684 718 685 719 RTNATIVETHREAD hNativeSelf = RTThreadNativeSelf(); … … 773 807 AssertPtr(pThis); 774 808 AssertReturn(pThis->u32Magic == RTCRITSECTRW_MAGIC, false); 809 #ifdef IN_RING0 810 Assert(pThis->fFlags & RTCRITSECT_FLAGS_RING0); 811 #else 812 Assert(!(pThis->fFlags & RTCRITSECT_FLAGS_RING0)); 813 #endif 775 814 776 815 /* … … 792 831 AssertPtr(pThis); 793 832 AssertReturn(pThis->u32Magic == RTCRITSECTRW_MAGIC, false); 833 #ifdef IN_RING0 834 Assert(pThis->fFlags & RTCRITSECT_FLAGS_RING0); 835 #else 836 Assert(!(pThis->fFlags & RTCRITSECT_FLAGS_RING0)); 837 #endif 794 838 795 839 /* … … 891 935 //Assert(pThis->cLockers == -1); 892 936 Assert(pThis->hNativeWriter == NIL_RTNATIVETHREAD); 937 #ifdef IN_RING0 938 Assert(pThis->fFlags & RTCRITSECT_FLAGS_RING0); 939 #else 940 Assert(!(pThis->fFlags & RTCRITSECT_FLAGS_RING0)); 941 #endif 893 942 894 943 /* … … 909 958 int rc2 = RTSemEventMultiDestroy(hEvtRead); AssertRC(rc2); 910 959 960 #ifndef IN_RING0 911 961 RTLockValidatorRecSharedDestroy(&pThis->pValidatorRead); 912 962 RTLockValidatorRecExclDestroy(&pThis->pValidatorWrite); 963 #endif 913 964 914 965 return RT_SUCCESS(rc1) ? rc2 : rc1;
Note:
See TracChangeset
for help on using the changeset viewer.