- Timestamp:
- May 31, 2010 2:53:33 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ProgressImpl.cpp
r29881 r29914 835 835 if (!mCompleted) 836 836 { 837 RTTIMESPEC time;838 RTTimeNow(&time); /** @todo r=bird: Use monotonic time (RTTimeMilliTS()) here because of daylight saving and things like that. */839 840 837 int vrc = VINF_SUCCESS; 841 838 bool fForever = aTimeout < 0; 842 839 int64_t timeLeft = aTimeout; 843 int64_t lastTime = RTTime SpecGetMilli(&time);840 int64_t lastTime = RTTimeMilliTS(); 844 841 845 842 while (!mCompleted && (fForever || timeLeft > 0)) … … 848 845 alock.leave(); 849 846 vrc = RTSemEventMultiWait(mCompletedSem, 850 fForever ? RT_INDEFINITE_WAIT : ( unsigned)timeLeft);847 fForever ? RT_INDEFINITE_WAIT : (RTMSINTERVAL)timeLeft); 851 848 alock.enter(); 852 849 mWaitersCount--; … … 861 858 if (!fForever) 862 859 { 863 RTTimeNow (&time);864 timeLeft -= RTTimeSpecGetMilli(&time)- lastTime;865 lastTime = RTTimeSpecGetMilli(&time);860 int64_t now = RTTimeMilliTS(); 861 timeLeft -= now - lastTime; 862 lastTime = now; 866 863 } 867 864 } … … 901 898 && aOperation >= m_ulCurrentOperation) 902 899 { 903 RTTIMESPEC time;904 RTTimeNow (&time);905 906 900 int vrc = VINF_SUCCESS; 907 901 bool fForever = aTimeout < 0; 908 902 int64_t timeLeft = aTimeout; 909 int64_t lastTime = RTTime SpecGetMilli (&time);903 int64_t lastTime = RTTimeMilliTS(); 910 904 911 905 while ( !mCompleted && aOperation >= m_ulCurrentOperation … … 928 922 if (!fForever) 929 923 { 930 RTTimeNow(&time);931 timeLeft -= RTTimeSpecGetMilli(&time)- lastTime;932 lastTime = RTTimeSpecGetMilli(&time);924 int64_t now = RTTimeMilliTS(); 925 timeLeft -= now - lastTime; 926 lastTime = now; 933 927 } 934 928 } … … 1592 1586 if (!mCompleted) 1593 1587 { 1594 RTTIMESPEC time;1595 RTTimeNow(&time);1596 1597 1588 HRESULT rc = S_OK; 1598 1589 bool forever = aTimeout < 0; 1599 1590 int64_t timeLeft = aTimeout; 1600 int64_t lastTime = RTTime SpecGetMilli(&time);1591 int64_t lastTime = RTTimeMilliTS(); 1601 1592 1602 1593 while (!mCompleted && (forever || timeLeft > 0)) … … 1613 1604 if (!forever) 1614 1605 { 1615 RTTimeNow(&time);1616 timeLeft -= RTTimeSpecGetMilli(&time)- lastTime;1617 lastTime = RTTimeSpecGetMilli(&time);1606 int64_t now = RTTimeMilliTS(); 1607 timeLeft -= now - lastTime; 1608 lastTime = now; 1618 1609 } 1619 1610 } … … 1679 1670 progress, operation)); 1680 1671 1681 RTTIMESPEC time;1682 RTTimeNow (&time);1683 1684 1672 bool forever = aTimeout < 0; 1685 1673 int64_t timeLeft = aTimeout; 1686 int64_t lastTime = RTTime SpecGetMilli (&time);1674 int64_t lastTime = RTTimeMilliTS(); 1687 1675 1688 1676 while (!mCompleted && aOperation >= m_ulCurrentOperation && … … 1702 1690 if (!forever) 1703 1691 { 1704 RTTimeNow(&time);1705 timeLeft -= RTTimeSpecGetMilli(&time)- lastTime;1706 lastTime = RTTimeSpecGetMilli(&time);1692 int64_t now = RTTimeMilliTS(); 1693 timeLeft -= now - lastTime; 1694 lastTime = now; 1707 1695 } 1708 1696 }
Note:
See TracChangeset
for help on using the changeset viewer.