Changeset 81413 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Oct 21, 2019 1:39:27 PM (5 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PDMR3Task.cpp
r81409 r81413 110 110 pTaskSet->idxRunning = UINT8_MAX; 111 111 //pTaskSet->fShutdown = false; 112 pTaskSet->pVM = pVM; 112 113 113 114 pVM->pdm.s.apTaskSets[i] = pTaskSet; … … 222 223 { 223 224 uint64_t fTriggered = ASMAtomicReadU64(&pTaskSet->fTriggered); 224 unsigned iTask; 225 while ( (iTask = ASMBitFirstSetU64(fTriggered)) != 0) 225 unsigned iTask = ASMBitFirstSetU64(fTriggered); 226 if (iTask == 0) 227 break; 228 do 226 229 { 227 230 iTask--; 228 231 AssertBreak(iTask < RT_ELEMENTS(pTaskSet->aTasks)); 229 232 230 fTriggered &= ~RT_BIT_64(iTask);231 233 if (ASMAtomicBitTestAndClear(&pTaskSet->fTriggered, iTask)) 232 234 { … … 276 278 ASMAtomicWriteU32(&pTaskSet->idxRunning, UINT32_MAX); 277 279 } 278 } 280 281 /* Next pending task. */ 282 fTriggered &= ~RT_BIT_64(iTask); 283 iTask = ASMBitFirstSetU64(fTriggered); 284 } while (iTask != 0); 279 285 } 286 287 /* 288 * Wait. 289 */ 290 if (pTaskSet->fRZEnabled) 291 SUPSemEventWaitNoResume(pTaskSet->pVM->pSession, pTaskSet->hEventR0, RT_MS_15SEC); 292 else 293 RTSemEventWaitNoResume(pTaskSet->hEventR3, RT_MS_15SEC); 280 294 } 281 295 … … 386 400 pTaskSet->idxRunning = UINT8_MAX; 387 401 //pTaskSet->fShutdown = false; 402 pTaskSet->pVM = pVM; 388 403 389 404 pVM->pdm.s.apTaskSets[i] = pTaskSet; … … 400 415 if (pTaskSet->hThread == NIL_RTTHREAD) 401 416 { 402 int rc = RTThreadCreateF(&pTaskSet->hThread, pdmR3TaskThread, 417 int rc = RTThreadCreateF(&pTaskSet->hThread, pdmR3TaskThread, pTaskSet, 0 /*cbStack*/, RTTHREADTYPE_IO, 403 418 RTTHREADFLAGS_WAITABLE, "TaskSet%u", pTaskSet->uHandleBase / RT_ELEMENTS(pTaskSet->aTasks)); 404 419 AssertLogRelRCReturn(rc, rc); -
trunk/src/VBox/VMM/include/PDMInternal.h
r81391 r81413 1026 1026 /** Event semaphore for waking up the thread when fRZEnabled is clear. */ 1027 1027 R3PTRTYPE(RTSEMEVENT) hEventR3; 1028 /** The VM pointer. */ 1029 PVM pVM; 1028 1030 /** Padding so fTriggered is in its own cacheline. */ 1029 uint64_t au64Padding2[ 4];1031 uint64_t au64Padding2[3]; 1030 1032 1031 1033 /** Bitmask of triggered tasks. */
Note:
See TracChangeset
for help on using the changeset viewer.