Changeset 28265 in vbox for trunk/src/VBox
- Timestamp:
- Apr 13, 2010 4:02:10 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60007
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMInternal.h
r28263 r28265 1026 1026 R3PTRTYPE(struct PDMQUEUE *) pQueuesForced; 1027 1027 1028 /** Head of the PDM Thread list. (singly linked) */1029 R3PTRTYPE(PPDMTHREAD) pThreads;1030 /** Tail of the PDM Thread list. (singly linked) */1031 R3PTRTYPE(PPDMTHREAD) pThreadsTail;1032 1033 1028 /** Lock protecting the lists below it. */ 1034 1029 RTCRITSECT ListCritSect; … … 1037 1032 /** List of initialized critical sections. (LIFO) */ 1038 1033 R3PTRTYPE(PPDMCRITSECTINT) pCritSects; 1034 /** Head of the PDM Thread list. (singly linked) */ 1035 R3PTRTYPE(PPDMTHREAD) pThreads; 1036 /** Tail of the PDM Thread list. (singly linked) */ 1037 R3PTRTYPE(PPDMTHREAD) pThreadsTail; 1039 1038 1040 1039 /** @name PDM Async Completion -
trunk/src/VBox/VMM/PDMThread.cpp
r28262 r28265 166 166 * Insert it into the thread list. 167 167 */ 168 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); 168 169 pThread->Internal.s.pNext = NULL; 169 170 if (pUVM->pdm.s.pThreadsTail) … … 172 173 pUVM->pdm.s.pThreads = pThread; 173 174 pUVM->pdm.s.pThreadsTail = pThread; 175 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 174 176 175 177 rc = RTThreadUserReset(Thread); … … 432 434 433 435 /* unlink */ 436 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); 434 437 if (pUVM->pdm.s.pThreads == pThread) 435 438 { … … 450 453 } 451 454 pThread->Internal.s.pNext = NULL; 455 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 452 456 453 457 /* free the resources */ … … 483 487 484 488 AssertPtr(pDevIns); 489 490 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); 485 491 PPDMTHREAD pThread = pUVM->pdm.s.pThreads; 486 492 while (pThread) … … 496 502 pThread = pNext; 497 503 } 498 504 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 499 505 return rc; 500 506 } … … 516 522 517 523 AssertPtr(pUsbIns); 524 525 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); 518 526 PPDMTHREAD pThread = pUVM->pdm.s.pThreads; 519 527 while (pThread) … … 529 537 pThread = pNext; 530 538 } 531 539 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 532 540 return rc; 533 541 } … … 549 557 550 558 AssertPtr(pDrvIns); 559 560 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); 551 561 PPDMTHREAD pThread = pUVM->pdm.s.pThreads; 552 562 while (pThread) … … 562 572 pThread = pNext; 563 573 } 564 574 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 565 575 return rc; 566 576 } … … 574 584 void pdmR3ThreadDestroyAll(PVM pVM) 575 585 { 576 PUVM pUVM = pVM->pUVM; 577 PPDMTHREAD pThread = pUVM->pdm.s.pThreads; 586 PUVM pUVM = pVM->pUVM; 587 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); 588 PPDMTHREAD pThread = pUVM->pdm.s.pThreads; 578 589 while (pThread) 579 590 { … … 584 595 } 585 596 Assert(!pUVM->pdm.s.pThreads && !pUVM->pdm.s.pThreadsTail); 597 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 586 598 } 587 599 … … 959 971 int pdmR3ThreadSuspendAll(PVM pVM) 960 972 { 961 for (PPDMTHREAD pThread = pVM->pUVM->pdm.s.pThreads; pThread; pThread = pThread->Internal.s.pNext) 973 PUVM pUVM = pVM->pUVM; 974 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); /* This may cause deadlocks later... */ 975 for (PPDMTHREAD pThread = pUVM->pdm.s.pThreads; pThread; pThread = pThread->Internal.s.pNext) 962 976 switch (pThread->enmState) 963 977 { … … 977 991 break; 978 992 } 993 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 979 994 return VINF_SUCCESS; 980 995 } … … 1048 1063 int pdmR3ThreadResumeAll(PVM pVM) 1049 1064 { 1050 for (PPDMTHREAD pThread = pVM->pUVM->pdm.s.pThreads; pThread; pThread = pThread->Internal.s.pNext) 1065 PUVM pUVM = pVM->pUVM; 1066 RTCritSectEnter(&pUVM->pdm.s.ListCritSect); 1067 for (PPDMTHREAD pThread = pUVM->pdm.s.pThreads; pThread; pThread = pThread->Internal.s.pNext) 1051 1068 switch (pThread->enmState) 1052 1069 { … … 1062 1079 break; 1063 1080 } 1081 RTCritSectLeave(&pUVM->pdm.s.ListCritSect); 1064 1082 return VINF_SUCCESS; 1065 1083 }
Note:
See TracChangeset
for help on using the changeset viewer.