Changeset 31018 in vbox
- Timestamp:
- Jul 22, 2010 4:59:41 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/defs.h
r30739 r31018 264 264 #define SUCCEEDED_WARNING(rc) (NS_SUCCEEDED (rc) && (rc) != NS_OK) 265 265 266 #define FAILED_DEAD_INTERFACE(rc) (false) /**< @todo */266 #define FAILED_DEAD_INTERFACE(rc) ( (rc) == NS_ERROR_ABORT ) 267 267 268 268 #define IUnknown nsISupports -
trunk/src/VBox/Main/EventImpl.cpp
r30913 r31018 61 61 #include <iprt/critsect.h> 62 62 #include <iprt/asm.h> 63 #include <iprt/time.h> 63 64 64 65 #include <VBox/com/array.h> … … 576 577 PassiveQueue mQueue; 577 578 int32_t mRefCnt; 579 uint64_t mLastRead; 578 580 579 581 public: … … 734 736 ::RTCritSectInit(&mcsQLock); 735 737 ::RTSemEventCreate (&mQEvent); 738 mLastRead = RTTimeMilliTS(); 736 739 } 737 740 } … … 805 808 { 806 809 AssertMsg(!mActive, ("must be passive\n")); 810 807 811 // put an event the queue 808 812 ::RTCritSectEnter(&mcsQLock); 813 814 // If there was no events reading from the listener for the long time, 815 // and events keep coming we shall unregister it. 816 if ((mQueue.size() > 200) && ((RTTimeMilliTS() - mLastRead) > 60 * 1000)) 817 { 818 ::RTCritSectLeave(&mcsQLock); 819 return E_ABORT; 820 } 821 809 822 mQueue.push_back(aEvent); 810 823 ::RTCritSectLeave(&mcsQLock); … … 826 839 827 840 ::RTCritSectEnter(&mcsQLock); 841 842 mLastRead = RTTimeMilliTS(); 843 828 844 if (mQueue.empty()) { 829 845 ::RTCritSectLeave(&mcsQLock); … … 1026 1042 cbRc = record.obj()->process(aEvent, aWaitable, pit, alock); 1027 1043 1028 if (FAILED_DEAD_INTERFACE(cbRc) )1044 if (FAILED_DEAD_INTERFACE(cbRc) || (cbRc == E_ABORT)) 1029 1045 { 1030 1046 Listeners::iterator lit = m->mListeners.find(record.obj()->mListener);
Note:
See TracChangeset
for help on using the changeset viewer.