Changeset 107259 in vbox
- Timestamp:
- Dec 9, 2024 1:21:14 PM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-all/ObjectsTracker.cpp
r107258 r107259 821 821 int64_t lifeTime = (int64_t)temp.m_lifeTime*1000; //convert to milliseconds 822 822 823 int64_t remainingLifeTime = ((creationTime + lifeTime) - currTime)/1000; 823 int64_t remainingLifeTime = lifeTime == 0 ? 0 : ((creationTime + lifeTime) - currTime)/1000; 824 825 bool fLifeTimeExpired = temp.m_fLifeTimeExpired; 826 if (!fLifeTimeExpired) 827 fLifeTimeExpired = (remainingLifeTime == 0 && lifeTime != 0) ? true : false; 824 828 825 829 /* lock? */ … … 835 839 )); 836 840 837 bool fLifeTimeEnd = (currTime - creationTime) > lifeTime ? true : false; 838 839 if (!fLifeTimeEnd) 841 if (fLifeTimeExpired) 840 842 { 841 if (cRefs <= 2 || remainingLifeTime <= 0)842 843 { 843 844 if (temp.m_fIdleTimeStart == false) … … 845 846 gTrackedObjectsCollector.initObjIdleTime(*Iter); 846 847 Log2(("Idle time for the object with Id %s has been started\n", Iter->c_str())); 848 Log2((" class IID %s, refcount %lu\n", temp.m_classIID.toString().c_str(), cRefs - 1)); 847 849 } 848 850 else … … 850 852 int64_t idleTime = (int64_t)temp.m_idleTime*1000; //convert to milliseconds 851 853 int64_t idleTimeStart = RTTimeSpecGetMilli(&temp.m_idleTimeStart); 852 bool f Obsolete= (currTime - idleTimeStart) > idleTime ? true : false;853 if (f Obsolete)854 bool fIdleTimeExpired = (currTime - idleTimeStart) > idleTime ? true : false; 855 if (fIdleTimeExpired) 854 856 { 855 857 Log2(("Object with Id %s removed from Object Collector " … … 870 872 if (lifeTime == 0) 871 873 { 872 /* set lifeTime to 60 sec (1 min) */873 lifeTime = 60; 874 temp.m_fLifeTimeExpired = true; 875 874 876 /* Updating the object data */ 875 gTrackedObjectsCollector.setObj(temp.objectIdStr(), 876 temp.classIIDStr(), 877 (uint64_t)lifeTime, 878 temp.m_idleTime, 879 temp.m_pIface); 880 } 881 else 882 { 883 Log2(("Object with Id %s removed from Object Collector " 884 "(lifetime exceeded %u sec)\n", Iter->c_str(), temp.m_lifeTime)); 885 gTrackedObjectsCollector.removeObj(*Iter); 877 gTrackedObjectsCollector.updateObj(temp); 886 878 } 887 879 }
Note:
See TracChangeset
for help on using the changeset viewer.