Changeset 27777 in vbox
- Timestamp:
- Mar 29, 2010 11:16:43 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59423
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r27760 r27777 208 208 VBoxVHWACommandProcessEvent () 209 209 : QEvent ((QEvent::Type) VBoxDefs::VHWACommandProcessType) 210 {} 210 { 211 #ifdef DEBUG_misha 212 g_EventCounter.inc(); 213 #endif 214 } 215 #ifdef DEBUG_misha 216 ~VBoxVHWACommandProcessEvent() 217 { 218 g_EventCounter.dec(); 219 } 220 221 static uint32_t cPending() { return g_EventCounter.refs(); } 222 private: 223 static VBoxVHWARefCounter g_EventCounter; 224 #endif 211 225 }; 212 226 213 227 #ifdef DEBUG_misha 228 VBoxVHWARefCounter VBoxVHWACommandProcessEvent::g_EventCounter; 229 #endif 214 230 215 231 VBoxVHWAHandleTable::VBoxVHWAHandleTable(uint32_t initialSize) … … 4680 4696 } 4681 4697 else 4698 { 4699 Assert(pCur->isNewEvent()); 4682 4700 bFirst = false; 4701 } 4683 4702 } while(1); 4684 4703 … … 4721 4740 void VBoxVHWACommandElementProcessor::postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData, uint32_t flags) 4722 4741 { 4723 bool bNeedNewEvent = false;4724 4742 QObject *pNotifyObject = NULL; 4725 4743 /* 1. lock*/ … … 4744 4762 if(mbNewEvent || (!mbProcessingList && m_CmdPipe.isEmpty())) 4745 4763 { 4746 pCmd->setNewEventFlag(); 4747 bNeedNewEvent = true; 4764 pCmd->setNewEvent(true); 4748 4765 mbNewEvent = false; 4766 if (m_pNotifyObject) 4767 { 4768 m_NotifyObjectRefs.inc(); /* ensure the parent does not get destroyed while we are using it */ 4769 pNotifyObject = m_pNotifyObject; 4770 #ifdef DEBUG_misha 4771 checkConsistence(); 4772 #endif 4773 } 4774 } 4775 else 4776 { 4777 pCmd->setNewEvent(false); 4778 #ifdef DEBUG_misha 4779 if (m_pNotifyObject) 4780 checkConsistence(); 4781 #endif 4749 4782 } 4750 4783 4751 4784 m_CmdPipe.put(pCmd); 4785 #ifdef DEBUG_misha 4786 if (m_pNotifyObject) 4787 { 4788 checkConsistence(1); 4789 } 4790 #endif 4752 4791 4753 4792 if((flags & VBOXVHWACMDPIPEC_COMPLETEEVENT) != 0) 4754 4793 mbNewEvent = true; 4755 4756 if (bNeedNewEvent)4757 {4758 if (m_pNotifyObject)4759 {4760 m_NotifyObjectRefs.inc(); /* ensure the parent does not get destroyed while we are using it */4761 pNotifyObject = m_pNotifyObject;4762 }4763 }4764 4794 4765 4795 RTCritSectLeave(&mCritSect); … … 4772 4802 } 4773 4803 } 4804 4805 #ifdef DEBUG_misha 4806 void VBoxVHWACommandElementProcessor::checkConsistence(uint32_t cEvents2Submit, const VBoxVHWACommandElementPipe *pPipe) 4807 { 4808 const VBoxVHWACommandElement *pLast; 4809 const VBoxVHWACommandElement *pFirst = pPipe ? pPipe->contentsRo(&pLast) : m_CmdPipe.contentsRo(&pLast); 4810 uint32_t cEvents = 0; 4811 4812 for (const VBoxVHWACommandElement * pCur = pFirst; pCur; pCur = pCur->mpNext) 4813 { 4814 if (pCur->isNewEvent()) 4815 { 4816 ++cEvents; 4817 Assert(cEvents <= VBoxVHWACommandProcessEvent::cPending() + cEvents2Submit); 4818 } 4819 } 4820 // Assert(cEvents == VBoxVHWACommandProcessEvent::cPending()); 4821 } 4822 #endif 4774 4823 4775 4824 void VBoxVHWACommandElementProcessor::putBack(class VBoxVHWACommandElement * pFirst2Put, VBoxVHWACommandElement * pLast2Put, … … 4782 4831 m_CmdPipe.prepend(pFirst2Put, pLast2Put); 4783 4832 mbProcessingList = false; 4833 Assert(pFirst2Put->isNewEvent()); 4834 #ifdef DEBUG_misha 4835 Assert(VBoxVHWACommandProcessEvent::cPending()); 4836 const VBoxVHWACommandElement *pLast; 4837 const VBoxVHWACommandElement *pFirst = m_CmdPipe.contentsRo(&pLast); 4838 Assert(pFirst); 4839 Assert(pLast); 4840 Assert(pFirst == pFirst2Put); 4841 checkConsistence(); 4842 #endif 4784 4843 RTCritSectLeave(&mCritSect); 4785 4844 } … … 4831 4890 } 4832 4891 4892 #ifdef DEBUG_misha 4893 checkConsistence(cEventsNeeded); 4894 #endif 4895 4833 4896 RTCritSectLeave(&mCritSect); 4834 4897 … … 4855 4918 mFreeElements.pusha(pFirst2Free, pLast2Free); 4856 4919 } 4920 4921 #ifdef DEBUG_misha 4922 checkConsistence(); 4923 #endif 4924 4857 4925 pList = m_CmdPipe.detachList(ppLast); 4926 4858 4927 if (pList) 4859 4928 { … … 4895 4964 } 4896 4965 4966 Assert(!mbProcessingList); 4967 4897 4968 pipe.prependFrom(&m_CmdPipe); 4898 4969 4899 4970 if(!pipe.isEmpty()) 4900 {4901 4971 mbProcessingList = true; 4902 *ppHead = pipe.detachList(ppTail);4903 }4904 4972 4905 4973 RTCritSectLeave(&mCritSect); 4974 4975 *ppHead = pipe.detachList(ppTail); 4906 4976 } 4907 4977 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
r27760 r27777 1208 1208 } 1209 1209 1210 void setNewEvent Flag() {bNewEvent = true;}1210 void setNewEvent(bool bNew) {bNewEvent = bNew;} 1211 1211 bool isNewEvent() const { return bNewEvent; } 1212 1212 … … 1294 1294 mpLast->mpNext = pFirst; 1295 1295 mpLast = pLast; 1296 pLast->mpNext = NULL; 1296 1297 } 1297 1298 } … … 1413 1414 void reset(class VBoxVHWACommandElement ** ppHead, class VBoxVHWACommandElement ** ppTail); 1414 1415 void setNotifyObject(QObject *pNotifyObject); 1416 #ifdef DEBUG_misha 1417 void checkConsistence(uint32_t cEvents2Submit = 0, const VBoxVHWACommandElementPipe *pPipe = NULL); 1418 #endif 1415 1419 private: 1416 1420 RTCRITSECT mCritSect;
Note:
See TracChangeset
for help on using the changeset viewer.